When I click the head, it does nothing. I have my click detector in the Head and everything seems to be fine. No error messages but nothing happens. Here is the script:
local Button = script.Parent
function onClick()
local Player = Brick.Parent:findFirstChild("Humanoid")
if (Player ~= nil) then
local Location = game:GetService('Players'):GetPlayerFromCharacter(Player.Parent)
local Button = Location.leaderstats.Gold
if Location.leaderstats.Gold.Value > 19 then
Location.leaderstats.Gold.Value = Location.leaderstats.Gold.Value - 20
script.Parent.Parent.Name = Player .. "'s House"
end
end
end
Target.ClickDetector.MouseClick:connect(onClick)

3 comments
You have a flaw on line 7. It's
>=not=>q.q
Thanks, Typos.