Script not functioning

Ok so basically in a server script I wrote this code, but it won’t print “yay”… I have been trying to figure this out for a long time

   ''''
     function Intermission()
     wait()
     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


   '''

Could anyone please tell me why?

2 Likes

It will print yay, but after 10 seconds. This is most likely what you’re looking for:

function Intermission()
	game.ReplicatedStorage.ShowVotes:FireAllClients()
	workspace.Sound1:Play()
	spawn(function()
		for i = 10,1,-1 do
			text.Value = "Intermission "..i
			wait(1)
		end
	end)
	print("Yay")
	game.ReplicatedStorage.Function:Fire()
	print("yay2")
end
1 Like

Ok I tried that, but it didn’t work sadly… no errors like last time, also I want it to print “yay” after 10 seconds

1 Like

I used this to call the function

     ''''
              
     while true do
        Intermission()
        break
     end


        '''
1 Like

Show me all of your code if you can

1 Like

Sorry I don’t want to leak all of my code…

  ''''

       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
    '''
1 Like

Check output whether there are any errors.

1 Like

There are no errors in the output

1 Like

Unrelated to the immediate problem, but the loop is unnecessary since you break out it immediately after invoking the function.

The reason why I put it there was because of a different problem, but anyway, what is the problem with my script?

1 Like

What type of instance is “ReplicatedStorage.Function”? I attempted to repro the problem but everything is working as intended.

1 Like

Where is that script located at?