#i need help with this script in my asym game
1 messages · Page 1 of 1 (latest)
here's the footage of me testing
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
** You are now Level 1! **
Send the code block
then write it again
print("hello world")
** You are now Level 2! **
** You are now Level 3! **
😭 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
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
if your scripts are extremely long theres a good chance you could benefit from either splitting them into more relevant parts or using modules
also helps with debugging cuz less code whilst also more organised
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
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
do you have any errors in output?
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
is label not mispelt
alr if you have no errors then its just the logic behind it
oh
meaning the only way forward is printing through to see whats happening
you mean debugging using print("")?
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
hmm
alright i'll try
so far it printed Round and Start
the rest didn't
this is what i put for the rest
i might as well rename it since technically it's mispelt in both the script and the main thing
** You are now Level 4! **
i really think this part of the server script is something realted so i might as well send this image