I need to increase the walkspeed of the player if they are in a certain group, I do not want to set it to a specific number but just increase it by a certain amount.
The print statement in the following code works but the script does not apply the change in speed.
I have tried searching for solutions on my own here and google but I have not found a suitable one including changing it to a local script.
local Players = game:GetService("Players")
local function onPlayerAdded(player)
if player:IsInGroup(4352234) then
print("player is in group")
local character = player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
humanoid.WalkSpeed = humanoid.WalkSpeed + 9
end
end
Players.PlayerAdded:Connect(onPlayerAdded)
Thank you for your time!