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

how to fix walk speed gamepass?

Asked by 3 years ago
Edited 3 years ago

if i play i wont get walk speed :(

script: local id = 14645123

game:GetService("MarketplaceService").PromptGamePassPurchaseFinished:Connect(function(plr,ido,purchased) if purchased and id == ido then plr.Character.Humanoid.Walkspeed = 40 end end)

game.Players.PlayerAdded:Connect(function(plr) if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(plr.UserId,id)then game.Workspace:WaitForChild(plr.Name):WaitForChild("Humanoid").WalkSpeed = 40 end end)

0
are you getting erros in the output window because usually you have to make a script with a fireserver() function in order to get stuff like this to work iamajunky 20 — 3y
0
I can't see the image or script Rayguyban2 89 — 3y
0
no errors in output moneyislands1 51 — 3y

3 answers

Log in to vote
0
Answered by 3 years ago

First off, Walkspeed should be WalkSpeed. Second, you cant confirm that the player is buying it unless you know the player. Hope this works :)

local id = 14645123

BuyEvent.OnServerEvent:Connect(function(Player)
    game:GetService("MarketplaceService").PromptGamePassPurchaseFinished:Connect(function(plr,ido,purchased)
        if purchased and id == ido and plr == Player then
            plr.Character.Humanoid.WalkSpeed = 40
        end
    end)
end)

game.Players.PlayerAdded:Connect(function(plr)
    if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(plr.UserId,id) then                       
        game.Workspace:WaitForChild(plr.Name):WaitForChild("Humanoid").WalkSpeed = 40
    end
end)
0
If this works please accept this answer deadwalker601 110 — 3y
0
ServerScriptService.Gamepass:3: attempt to index nil with 'OnServerEvent' moneyislands1 51 — 3y
0
Buy event is a remote event that gets fired when you click a ui button. deadwalker601 110 — 3y
0
Buy event is a remote event that gets fired when you click a ui button. deadwalker601 110 — 3y
Ad
Log in to vote
0
Answered by
Oxprem 140
3 years ago

Howdy, there are two possibilities that your script isn't working

  1. You are setting both WalkSpeed's to 40, purchasing it or not.

  2. It is waiting for the plr or the humanoid but can't find it.

Log in to vote
0
Answered by 3 years ago

Do you own the gamepass?

1
yes, and i tryed local server and buy it again but not worked too moneyislands1 51 — 3y

Answer this question