Ok so I’m trying to make a round script then I come across an error. The in the script below everything prints fine, but it doesn’t print “hi2”. I have no clue why, but that is causing the rest of my script to fail.
-- Serverscript in serverscriptservice
function Intermission()
game.ReplicatedStorage.ShowVotes:FireAllClients()
workspace.Sound1:Play()
for i = 10,1,-1 do
text.Value = "Intermission "..i
wait(1)
end
print("Yay")
game.ReplicatedStorage.Function:Fire()
print("yay2")
end
while true do
Intermission()
break
end
game.ReplicatedStorage.Function2.Event:Connect(function()
print("Hi")
local function Gamemode()
wait()
game.ReplicatedStorage.WhichGamemode.OnInvoke = function(chosen)
print("Hi2") -- here is print statement that doesn't print
The script is unfinished it seems like it, please correct it. "Hi2" doesn’t print straight away because obviously, Function2.Event needs to be fired, Gamemode needs to be called, and WhichGamemode.OnInvoke needs to be informed, until "Hi2" gets printed. If your problem is "Hi2" not printing when those things happen, it might be a problem with Function2.Event, maybe it’s not firing.
Pls no, just do Intermission(), you not need the whole while-loop. And what exact is not printing? Everthing or just some lines? Then:
Have you tried the debugger? If no, before you ask me „But how the debugger works?“, then just use a very magical machine. Its name is google, srly.
I did that for a reason… So basically, I want to fire the function once so it starts, then the loop breaks because from now on, that function will fire once the round is over
First, you didn’t end your functions, that might cause an error, because after it runs, it didn’t end, but I am not sure. And second, why are you calling that while loop if the code runs only once? You break it right after the function finishes.