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

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

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

1 comment

0

You did = instead of ==.

1 answer

✓ Accepted answer

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!

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