What is the error? So basically when the player touches the block and if they have the value = or over 3 they get the cash
The error outputed in the output log is this " 15:11:55.994 - Workspace.MoneyPunch.Script:6: attempt to index nil with ‘JewerlyPunch’"
local bin = script.Parent
local function onTouched(bin)
local plr = game.Players:GetPlayerFromCharacter(bin.Parent)
if plr.JewerlyPunch.Punch.Value >= 3 then
plr.Stats.Credits.Value = plr.Stats.Credits.Value + 1000
end
end
bin.Touched:connect(onTouched)
The leaderboard nothing is wrong with this, this is to help
game.Players.PlayerAdded:connect(function(p)
local stats = Instance.new("Folder")
stats.Name = "JewerlyPunch"
stats.Parent = p
local punch = Instance.new("IntValue")
punch.Name = "Punch"
punch.Parent = stats
local here = Instance.new("BoolValue")
here.Name = "Here"
here.Parent = stats
here.Value = false
end)