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

Why This ingroup walkspeed and health script not working?

Asked by
luc663 2
9 years ago
local GroupId = 2520927
local player = game:GetService("Players").LocalPlayer.Character
local plr = game:GetService("Players").LocalPlayer

game.Players.PlayerAdded:connect(function()
    if plr:IsInGroup(GroupId) then
        player.Humanoid.WalkSpeed = player.Humanoid.WalkSpeed +8
        player.Humanoid.MaxHealth = player.Humanoid.MaxHealth +50
    end
end)

1 answer

Log in to vote
0
Answered by 9 years ago

First of all you can only use game.Players.LocalPlayer in a LocalScript, though you can't listen for the game.Players.PlayerAdded event in a LocalScript.

Also, I'm not sure if you can edit the MaxHealth and WalkSpeed using a LocalScript.

You could take a look at RemoteEvents, or just use a server script for all of it.

Ad

Answer this question