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

Workspace.Main:14: attempt to concatenate global 'num' (a nil value) Idk?

The Source is


local s = script.Stat t = 0 while true do t = 15 repeat t = t-1 s.Value = "Intermission.. "..t wait(1) until t == 0 s.Value = "Race Is Starting!" wait(2) local plrs = game.Players:GetChildren() for i = 1,#plrs do plrs[i].Character.Head.CFrame = CFrame.new(workspace.Teleports["Part"..num].Position) end t=60 repeat t = t-1 s.Value = t.." Seconds Left" wait(1) until t ==0 end


Im Not Sure How to Fix This

1 comment

0

You only need to press the code block button once, then paste your code inside the two tilde lines. Other than that, from what I see you have a ton of loops running in this. What are you attempting to accomplish?

1 answer


local s = script.Stat 
t = 0 
while true do 
	t = 15 
	repeat 
		t = t-1 
		s.Value = "Intermission.. "..t 
		wait(1) 
	until t == 0 
	s.Value = "Race Is Starting!" 
	wait(2)
	local plrs = game.Players:GetChildren() 
	for i = 1,#plrs do 
		plrs[i].Character.Head.CFrame = CFrame.new(workspace.Teleports["Part"..num].Position) 
	end 
	t=60 
	repeat 
		t = t-1 
		s.Value = t.." Seconds Left" 
		wait(1) 
	until t ==0 
end

Next time give us the whole script and you need to highlight the whole script then click code block. Anyways what im assuming is that you never set what num equals so you should set what is equals. Also it might be a part so you would need like num.Name

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