Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

ServerScriptService Error Help me! MrLordFearLT?

Asked by 6 years ago

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.

0
add `]` on the end of line 1 theCJarmy7 1293 — 6y

1 answer

Log in to vote
1
Answered by
LeadRDRK 437 Moderation Voter
6 years ago

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()
Ad

Answer this question