Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Give cash when touched?

Asked by 10 years ago

Changed orginale script! Because i needs ServerScriptService and not workspace. Do you guys help me to fix it?

01local ting = 0
02 
03function onTouched(hit)
04    if ting == 0 then
05    ting = 1
06    check = hit.Parent:FindFirstChild("Humanoid")
07 
08    if check ~= nil then
09 
10        local user = game.Players:GetPlayerFromCharacter(hit.Parent)
11        local cashmoney = game.ServerStorage.MoneyStorage:FindFirstChild(player.Name)
12 
13        if cashmoney ~= nil then 
14        cashmoney.Value = cashmoney.Value + 250
15        end
View all 23 lines...

1 answer

Log in to vote
1
Answered by 10 years ago

Line 11 - You use a nil value Change the 'player' to 'user' in line 11

0
Thanks :) minetrackmania 186 — 10y
Ad

Answer this question