I noticed that whenever I add a wait() function to the scripts I am making, they stop once the wait function arrives, even though the times is a very little interval of time... could anyone help me?
Examples:
local original = script.Parent.Parent
local up = script.Parent.Parent.Parent.Arrival
script.Parent.PromptButtonHoldEnded:Connect(function(plr)
if plr.Team ~= game.Teams.CD then
local goalData = {CFrame = up.CFrame}
local tween = game.TweenService:Create(script.Parent.Parent,TweenInfo.new(4),goalData)
tween:Play()
wait(4) --Stops right here!!
goalData = {CFrame = original.CFrame}
local tween = game.TweenService:Create(script.Parent.Parent,TweenInfo.new(4),goalData)
tween:Play()
end
end)
script.Parent.MouseButton1Down:Connect(function()
local player = game.Players.LocalPlayer
local bname = "CD"
player.Character.Humanoid.Health = 0
if player.Team == game.Teams.Choosing then
game.ReplicatedStorage.RemoteEvents.Teams:FireServer(bname)
end
script.Click:Play()
wait(5)
local CurrentCamera = workspace.CurrentCamera
CurrentCamera.CameraType = Enum.CameraType.Custom
CurrentCamera.CameraSubject = game.Players.LocalPlayer
script.Parent.Parent.Parent.Enabled = false
game.Workspace.Musics.Menu:Stop()
game.Workspace.Musics.Background:Play()
end)

1 comment
Didn't save my formatting sorry