When a pickaxe collides with the object it is supposed to give you raw robloxs (the in game currency), but it doesn't work. Any help would be appreciated.
local part = script.Parent.Handle
local oof = game:GetService("Workspace").Model.Oof
local leaderstats = game.Players.LocalPlayer:WaitForChild("leaderstats")
script.Parent.Touched:Connect(function(hit)
if hit.Parent.Name == "Pick" then
leaderstats('Raw Robloxs').Value = leaderstats('Raw Robloxs').Value + 5
end
end)

10 comments
Errors?
Workspace.Model.Oof.Script:10: unexpected symbol near '?'
I don't see a '?'
I know.
Which part is supposed to be the part that gives the currency, the handles?
Well once the handle touches the brick it will give the leaderstat. So the brick is the thing that is giving the money.
Ok I see, at line 5 replace it with part.Touched:Connect(function(hit)
Try leaderstats['Raw Robloxs'].Value
Ok, i'll try.
Still doesn't work. /: