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

Why This ingroup walkspeed and health script not working?

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

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.

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