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

I need some help with a start button that wont function correctly?

Asked by
kom297 -4
6 years ago

Here is my script

01local Object = game.Lighting.NPC:Clone()
02local cloneMade = script.Parent.Parent.Parent.cloneDoingMaze
03 
04function startNPC()
05    Object.Parent = game.Workspace
06end
07 
08script.Parent.Touched:Connect(function()
09    if cloneMade == false then
10        startNPC()
11        wait(0.1)
12        cloneMade = true
13    else
14        script.Parent.Parent.Name = "There is already an npc doing the maze"
15    end
16end)
0
First off, don't store things in Lighting; put them in ServerStorage. turtle2004 167 — 6y
0
Sorry its how i learned scripting :/ ill start doing that kom297 -4 — 6y
0
Also, if "cloneMade" is a BoolValue instance then you need to add ".Value" when referring to its value property, otherwise you will be referring to the instance itself. tomas7777 20 — 6y
0
Im stupid i forgot to add that xd thanks for pointing that out kom297 -4 — 6y

Answer this question