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

How to i Create a Repawn Script And the Player receives Cash and XP?

Asked by 8 years ago
Edited 8 years ago

with this script i want Create that Noob is Model and if noob died then Respawn noob Give Xp and Cash and error is "plr(a nil value)"

local model = script.Parent
local backup = model:Clone()
plr = game.Players.LocalPlayer
Cash = plr:WaitForChild("stats").Cash
XP = plr.stats.XP

script.Parent.Humanoid.Died:connect(function()
    wait(1)
    model:remove()
    Cash.Value = Cash.Value +30
    XP.Value = XP.Value +10
    model = backup:Clone()
    wait(4)
    model.Parent = game.Workspace
    model:MakeJoints()
end)

0
Using the word noob makes me not even want to help,but ugh.. Going to need more info like whether you're working with a local or normal script since it says plr is a nil value. Meltdown81 309 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

Is it a script? If so you can't get the local player through script

Ad

Answer this question