#i need help with this script in my asym game

1 messages · Page 1 of 1 (latest)

fast ravine
#

so i'm quite new to scripting and i wanted this system works like it supposed to be, but for some reason when i test it out the killer gets morphed early when round didn't even started and survivor didn't get morphed too, to make it even worst when the timer reached to 0 rounds didn't start

#

as you can see when there's 2 players inside the game the countdown works but for some reason the killer gets to morph before the round even starts, oh not to mention the survivor doesn't even get morphed either and rounds didn't start when the timer hits 0

#

I followed up a tutorial on how to make an asymmerty type game and this is what i've got so far

grave fableBOT
#

studio** You are now Level 1! **studio

round night
#

Send the code block

fast ravine
#

code block?

#

i don't know what that is sorry

round night
#

write the three ` of this symbole

#

then write lua

misty ivy
round night
#

then write it again

round night
misty ivy
#
print("hello world")
fast ravine
#

oh

#

alright

grave fableBOT
#

studio** You are now Level 2! **studio

grave fableBOT
#

studio** You are now Level 3! **studio

junior robin
#

😭 bro

#

this may aswell be a book

#

i doubt anyone will react to this so instead ill give some advice

start with steps
when you jump into entire logic its extremely difficult to debug and add on

#

you have an issue and send 10 scripts to debug it being my point

#

you can disable scripts and go one by one making sure they wont how you want
if not you can ask for help and your much more likely to recieve help with one script

fast ravine
#

oh

#

well im quite entirely new to scripting and i wanted to fix the problem im having now

#

those scripts that i sent are actually 2 scripts which i have to send in seperate parts due to discord's text limit

#

im also sorry if it's too long since most of the parts of the scripts doesn't related to the problem im having now

junior robin
#

also helps with debugging cuz less code whilst also more organised

fast ravine
#

oh

#

i can prob cut out some of the unrealted scripts

#

thanks for the advice though

junior robin
#

yeah send the error you get in output and where its saying that is

#

ill see if i can help ive done something somewhat similar

fast ravine
#
CoreEvent.OnClientEvent:Connect(function(eventtype, Arg1, Arg2)
    if eventtype == "Round" then
        local Roundtype = Arg1
        
        if Roundtype == "Start" then
            local Duration = Arg2
            
            CoreGUI.RoundFrame.RoundTextLabel.Text = "Intermission:"
            for i = Duration,0,-1 do
                if BreakLoop then
                    CoreGUI.RoundFrame.RoundTextLabel.Text = "Waiting for more players..."
                    CoreGUI.RoundFrame.CountDownTextLable.Text = ""
                    BreakLoop = false
                    break
                end
                
                CoreGUI.RoundFrame.CountDownTextLable.Text = tostring(i)
                
                task.wait(1)
            end
            -- Fire event to server to start the round when timer reaches 0
            StartRoundEvent:FireServer()
        elseif Roundtype == "Clear" then
            BreakLoop = true
        elseif Roundtype == "In progress" then
            local Duration = Arg2
            CoreGUI.RoundFrame.RoundTextLabel.Text = "Round ends in:"
            CoreGUI.HotBarFrame.Visible = true
            CoreGUI.InfoFrame.Visible = true
            
            for i = Duration,0,-1 do
                if BreakLoop then
                    CoreGUI.RoundFrame.RoundTextLabel.Text = "Round starting soon.."
                    CoreGUI.RoundFrame.CountDownTextLable.Text = ""
                    BreakLoop = false
                    break
                end

                local Minutes = math.floor(i/60)
                local Seconds = i%60
                local Time = string.format("%02d:%02d", Minutes, Seconds)
                
                CoreGUI.RoundFrame.CountDownTextLable.Text = Time

                task.wait(1)
            end
        end
#

here's probably the only part of the script that i think is broken or some sort

#

it's a round system

#

and the script is inside a local script

#

i can get to the character morphing later if you needed to check on it

junior robin
fast ravine
#

no

#

there's no errors at all

#

i would fix the error right away when there's one usually

#

i can perhaps send another part of the script that is serverside and uses to tell if there's 2 players or more to actually start the intermission countdown and round starts

junior robin
#

is label not mispelt

fast ravine
#

oh

#

hol on

#

maybe not

junior robin
#

alr if you have no errors then its just the logic behind it

fast ravine
#

oh

junior robin
#

meaning the only way forward is printing through to see whats happening

fast ravine
#

you mean debugging using print("")?

junior robin
#

kinda

#
CoreEvent.OnClientEvent:Connect(function(eventtype, Arg1, Arg2)
    print(eventtype)
    if eventtype == "Round" then
        print("reached round")
        local Roundtype = Arg1
        
        if Roundtype == "Start" then
            print("reached start")
            local Duration = Arg2
fast ravine
#

hmm

#

alright i'll try

#

so far it printed Round and Start

#

the rest didn't

#

this is what i put for the rest

fast ravine
grave fableBOT
#

studio** You are now Level 4! **studio

fast ravine
#

i really think this part of the server script is something realted so i might as well send this image

junior robin
#

i dont see anything wrong with it

#

youll likely either have to debug

#

or rebuild

#

i have a feeling you did alot of code without debugging along the way

#

so im not sure where your issue is

fast ravine
#

probably

#

i did infact debugged a lot of times and things didn't work out

#

the best option for me is to either recode or try to figure out it's main logic and problems

#

thanks for your help though, i really appreciate your efforts on helping me