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

I need to delete this "Ore" when I click it is + by 15. Help? [Solved]

Asked by 4 years ago
Edited by Ziffixture 4 years ago

Code down here.

local clickdetector = script.Parent:WaitForChild("ClickDetector")

clickdetector.MouseClick:Connect(function()

    _G.orevalue = _G.orevalue + 5
    workspace.Ore.SurfaceGui.TextLabel.Text = (_G.orevalue.. " Ore")
    script.Parent.ClickDetector.MaxActivationDistance = 0
    wait(1)
    script.Parent.ClickDetector.MaxActivationDistance = 32


end)

-- down here is the problemo!


if _G.orevalue = _G.orevalue + 15 do

    script.Parent:Destroy()




end
0
You did = instead of ==. iiDkOffical 109 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

On line 17, you used =, this is used to set the value of something, you would use == to check the value of something, hope this helped!

Ad

Answer this question