--This is a normal script
01 | local db = true |
02 |
03 | script.Parent.Touched:connect( function (hit) |
04 | if hit.Parent:FindFirstChild( "Humanoid" ) ~ = nil then |
05 | if db = = true then |
06 | db = false |
07 | script.Parent.Transparency = 1 |
08 | local player = game.Players:GetPlayerFromCharacter(hit.Parent) |
09 | game.Players.LocalPlayer.Character.BackPack:WaitForChild( "Hamburger" ) |
10 | player.leaderstats.Candy.Value = player.leaderstats.Candy.Value + 100 |
11 | script.Sound:Play() |
12 | script.Parent:Destroy() |
13 |
14 |
15 | end |
16 | end |
17 |
18 |
19 | end ) |
Line 9, change "game.Players.LocalPlayer" to "player". Server scripts can’t use LocalPlayer as it is nil to them, and the script already knows who the player is by "player".