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

Gamepass to increase walkspeed?

Asked by 6 years ago
Edited 6 years ago

Making a gamepass to increase walkspeed, tried a script - didn't work.

local passId = 905520026 game.Players.PlayerAdded:connect(function() function isAuthenticated(player) return game:GetService("GamePassService"):PlayerHasPass(player, passId) end

game.Players.PlayerAdded:connect(function(plr)
     if isAuthenticated(plr) then
repeat wait(0.001) until game.Players.LocalPlayer.Character.Humanoid
         game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = game.Players.LocalPlayer.Character.Humanoid.WalkSpeed + 4
     end
end)

end)

2 answers

Log in to vote
0
Answered by
phxtn 154
6 years ago

humanoid doesnt exist in game.Players

It does exist in Workspace.

Ad
Log in to vote
0
Answered by 6 years ago

Yes thats true, to find the locaplayer in workspace becuz localplayer isnt a thing, you needa do

game.Workspace:FindFirstChild(game.Players.LocalPlayer.Name)

Anyways heres the script, hope it works

local localplayer = game.Workspace:FindFirstChild(game.Players.LocalPlayer.Name)
game.Players.PlayerAdded:connect(function(plr)
     if isAuthenticated(plr) then
repeat wait(0.001) until localplayer.Humanoid
         localplayer.Humanoid.WalkSpeed = localplayer.Humanoid.WalkSpeed+ 4
     end
end)

if this works accept my answer so i can get reputation :)

Answer this question