I tried making it so if they are in my group they get a 5% more walkspeed. It wont work for some reason here it is.
local groupId = 2578189
local speed = 17
local function newPlayer( player )
if player:IsInGroup(groupId) then -- if player isingroup
player.CharacterAdded:connect(function( character ) -- wait for character
local humanoid = character.Humanoid -- character's humanoid
if humanoid then -- if humanoid exisits
humanoid.WalkSpeed = speed -- set speed
end;
end);
end;
end
game.Players.PlayerAdded:connect( newPlayer ) -- connect event to callback func
table.foreach(game.Players:GetPlayer(), function(i, v)
newPlayer( v )
end)
Please tell me where I went wrong or what the script is supposed to be. Thanks in advance
