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
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!