game.Players.PlayerAdded:Connect(function(plr) if game:GetMarketService("MarketplaceService"):UserOwnsPassAsync(plr.Id, 1623743476843467525764762345273567473564576235673) then plr.CharacterAdded:Connect(function() wait() char:FindFirstChild("Humanoid").WalkSpeed = 20 end end end)
please help
Use UserOwnsGamePassAsync to check if the player has a pass:
local gamepassId= YOUR GAMEPASS's ID game.Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function() local hasGamepass = game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId, gamepassId) if hasGamepass then plr.Character:FindFirstChild("Humanoid").WalkSpeed = 200 end end) end)
Keep in mind that hackers can change their characters physics which means they can change their speed. You should have some sort of check to see if they DON'T own the gamepass and they're faster than normal.
The script would look something like this:
local gamepassId = YOUR GAMEPASS's ID local previousPositions = {} local MAX_SPEED = 25 function checkMovement(player) local character = player.Character if character then local hasGamepass = game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId, gamepassId) local previousPosition = previousPositions[player.Name] if not hasGamepass and previousPosition then local distanceTraveled = (Vector3.new(previousPosition.X,0,previousPosition.Z) - Vector3.new(character.HumanoidRootPart.Position.X,0,character.HumanoidRootPart.Position.Z)).magnitude print(distanceTraveled) if distanceTraveled > MAX_SPEED then player.Character.HumanoidRootPart.Position = previousPositions[player.Name] end end previousPositions[player.Name] = player.Character.HumanoidRootPart.Position end end while wait(1) do for _, player in pairs(game.Players:GetPlayers()) do checkMovement(player) end end --remove player from previousPositions table when they leave the game game.PlayerRemoving:Connect(function(player) previousPositions[player.Name] = nil end)
Previous Script:
game.Players.PlayerAdded:Connect(function(plr) if game:GetMarketService("MarketplaceService"):UserOwnsPassAsync(plr.Id, 1743777) then -- what is getmarketservice? Use GetService. Also, its UserOwnsGamePassAsync and plr .Id should be plr.UserId plr.CharacterAdded:Connect(function() wait() char:FindFirstChild("Humanoid").WalkSpeed = 20 end end end)
Updated script:
local id = id game.Players.PlayerAdded:Connect(function(plr) if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(plr.UserId, id) then plr.CharacterAdded:Connect(function() wait() plr.Character:FindFirstChild("Humanoid").WalkSpeed = 20 -- Change this to what walkspeed you want, default is 16. end) end end)