Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

My script tends to skip the intermission?[This script is driving me nuts]

I created this script for my mini-game place. It tends to skip the intermission?

I think this is very easy to solve

hmmmm....

local Intermission = game.Workspace.Intermission -- READ: (This is an IntValue)
game.Players.LocalPlayer.CharacterAdded:Connect(function(Character)	
while true do
	wait(1)
	Intermission.Value = Intermission.Value - 1
	script.Parent.Text = Intermission.Value
	if Intermission.Value == 0 then
		local String = "Teleporting Players..."
		
		for i = 1, #String do
			script.Parent.Parent.Index.Text = string.sub(String, 1, i)
		end
		
		wait(3)
		break
	end
end
end)

1 comment

0

Most likely because you're having multiple clients modify a global value, making it subtract faster.

1 answer

In this situation, i think you need to use repeat here:

local Intermission = game.Workspace.Intermission -- READ: (This is an IntValue)
game.Players.LocalPlayer.CharacterAdded:Connect(function(Character) 
while true do
    wait(1)
repeat
    Intermission.Value = Intermission.Value - 1
    script.Parent.Text = Intermission.Value
 wait(1)
until script.Parent.Value <= 0 
    -- we no longer need a if statement
        local String = "Teleporting Players..."

        for i = 1, #String do
            script.Parent.Parent.Index.Text = string.sub(String, 1, i)
        end

        wait(3)
        break
end
end)

I hope it worked :D

3 comments

0

I appreciate the answer man, But roblox studio took a big fat L, ashamed that it did not work. Thanks for your time and perception :D

1

Here's an up-vote since you responded nicely.

0

Sorry, i saw a bit of mistake and fixed it :D, maybe you could check it again?

This discussion is preserved as it was. New answers, comments, and votes are closed.