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

local bin = script.Parent
local function onTouched(part)
	
	local plr = game.Players:GetPlayerFromCharacter(part.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)

8 comments

0

what u mean?? the error gets displayed in the output log just click on it

0

explain what it should do and explain what it does atm

0

The is no error in the output log

0

Soz I forgot to put a desc

0

It should work fine, have you got the actual 3 value when you tested it?

0

Yes, I'm really puzzled why this isn't working.

0

can you use prints to debug?

0

I think I know which part it is now thx