I currently have a script that gives the player a point if they are touching the block. When you start touching the block, in the output it says “attempt to call a string value” and doesn’t update the leaderboard. Know any fixes?
local part = script.Parent
local canGet = true
local function onTouch(otherPart)
local humanoid = otherPart.Parent:FindFirstChild('Humanoid')
if humanoid then
local player = game.Players:FindFirstChild(otherPart.Parent.Name)
if player and canGet then
canGet = false
player.leaderstats.Points.Value = player.leaderstats.Points.Value + 1
wait(10)
canGet = true
end
end
end
part.Touched:Connect("onTouch")