Im trying to make a timer that when the timer reaches 0 it changes intermission value to false also there is a gui in the player that fires the Join event every time the timer value changes

local rStorage = game:GetService("ReplicatedStorage")
local configs = rStorage:WaitForChild("Configs")

while true do
	wait(1)
	if configs.Intermission.Value == true then
	local timer = 15
	repeat
	configs.RoundValue.Value = "Intermission:"..timer
	wait(1)
	timer = timer - 1
	until timer == 0
	configs.Intermission.Value = false
	end
	configs.RoundValue.Value = "Starting..."
	wait(1)
	local function Teleport(player)
		if configs.Intermission.Value == false then
			local plr = game.Workspace:FindFirstChild(player)
			print(player)
			local torso = plr.Torso
			torso.CFrame= CFrame.new(Vector3.new(0,0,0))
		end
	end
	rStorage.RemoteEvents.Join.OnServerEvent:Connect(Teleport)
end

When i test, the timer works but when the round value is 'starting' it doesnt teleport, my ouput says that there is no player, i tested adding print(plr) but is nil, how do i fix that

2 comments

0

You can't get Player's Character in WorkSpace(in that way). Player.Character will work out https://developer.roblox.com/api-reference/property/Player/Character

0

THX