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

ServerScriptService Error Help me! MrLordFearLT?

Hello im new at this and im trying to understand and make some scripts but i dont know how to fix this mistake. writes red in output

***04:52:46.877 - ServerScriptService.Script:45: ']' expected near 'v'***

Can Someone Say Whats Wrong

Thanks Sorry if english bad its for me not first language! script

		local Spawns = Clone.Spawns:GetChildren()[math.random(1, #Clone.spawn:GetChildren())
		v.Character:SetPrimaryPartCFrame(Spawn.CFrame * CFrame.new(0, 5,0))
		Spawn:Destroy()

Thanks Again for wasting your time.

1 comment

0

add ] on the end of line 1

1 answer

✓ Accepted answer

Uhh, you forgot to close "[math.random(1, #Clone.spawn:GetChildren())". That's what the error was trying to tell you.

local Spawns = Clone.Spawns:GetChildren()[math.random(1, #Clone.spawn:GetChildren())]
v.Character:SetPrimaryPartCFrame(Spawn.CFrame * CFrame.new(0, 5,0))
Spawn:Destroy()

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