Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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)

1 comment

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.

1 answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.