function ded(hahadedgobrrr)
game.Players.LocalPlayer.leaderstats.XP.Value = game.Players.LocalPlayer.leaderstats.XP.Value + 25
end
script.Parent.Humanoid.Died:Connect(ded)
Code above
Im trying to make an rpg but this no work!
function ded(hahadedgobrrr)
game.Players.LocalPlayer.leaderstats.XP.Value = game.Players.LocalPlayer.leaderstats.XP.Value + 25
end
script.Parent.Humanoid.Died:Connect(ded)
Code above
Im trying to make an rpg but this no work!
local xp_stat = game:GetService("Players").LocalPlayer:WaitForChild("leaderstats"):WaitForChild("XP")
local humanoid = script.Parent:FindFirstChildOfClass("Humanoid") or script.Parent:WaitForChild("Humanoid")
coroutine.wrap(function()
humanoid.Died:Wait()
xp_stat.Value += 1
end)()
might have grammar errors, i wrote this from the comments
You cannot add stats from a local script. This allows exploiters to instantly give themselves inf exp.
-- make sure this is in a server script
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local humanid = character:WaitForChild'Humanoid'
humanoid.Died:Connect(function()
player.leaderstats.XP.Value += 25
end
end)
end)
buti did not even use one
1st off spelling error 2nd off it thinks you forgot to close function at line 6 then 3rd is some stuff is expected to stop at line 2 or something
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
oof