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

local Object = game.Lighting.NPC:Clone()
local cloneMade = script.Parent.Parent.Parent.cloneDoingMaze

function startNPC()
    Object.Parent = game.Workspace
end

script.Parent.Touched:Connect(function()
    if cloneMade == false then
        startNPC()
        wait(0.1)
        cloneMade = true
    else
        script.Parent.Parent.Name = "There is already an npc doing the maze"
    end
end)
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