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

My Click detector script is not working And dosent have any errors?

So i tried making it so you can buy more max health in my game With click detectors But.. it dosent work and there isnt even any errors

local part = script.Parent
local detector = part.ClickDetector
detector.MouseClick:Connect(function(player)
	local leaderstats = player.leaderstats
	if leaderstats.Money.Value >= 8 then
		leaderstats.Money.Value -= 8
		leaderstats.MaxHealth += 12
	    player.Character.Humanoid.MaxHealth += 12
	end
end)

4 comments

0

Is this a localscript or serverscript

0

serverscript

0

i changed it to a local script and there is still no difference

0

Hmmmm, as a beginner i would take a look to remove the ')' in-front of 'end' inside of the Script!

3 answers

Have you tried removing the ')' in-front of the 'end' in the Script? You can very easily get wrong.

Alright this is another answer since of 2 nd answered.

If you want to save (132744), make sure you have enabled API and soemthing in game that can be saved. That's my opinion as an early beginner

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