Im not good with outputs, this is the output: 10:14:12.531 - Workspace.Part.WalkSpeed:32: Expected 'end' (to close 'then' at line 6), got <eof>
and this is the code:
local debounce = false function onTouch(part) local human = part.Parent:findFirstChild("Humanoid") if (human ~= nil) and debounce == false then debounce = true local id = 7549271 game:GetService("MarketplaceService").PromptGamePassPurchaseFinished:Connect(function(plr,ido,purchased) if purchased and ido == id then plr.Character.Humanoid.WalkSpeed = 40 end end) game.Players.PlayerAdded:Connect(function(plr) plr.CharacterAdded:connect(function(char) if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(game.Players[char.Name].UserId, id) then char.Humanoid.WalkSpeed = 40 human.WalkSpeed = 40 else human.Walkspeed = 20 wait(1) debounce = false script.Parent.Touched:connect(onTouch) end end) end)
local id = 7549271 game:GetService("MarketplaceService").PromptGamePassPurchaseFinished:Connect(function(plr,ido,purchased) if purchased and ido == id then if plr.Character then plr.Character:WaitForChild("Humanoid").WalkSpeed = 40 end end end) game.Players.PlayerAdded:Connect(function(plr) plr.CharacterAdded:connect(function(char) if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(plr.UserId,id) then char.Humanoid.WalkSpeed = 40 else char.Humanoid.WalkSpeed = 20 end end) end)
If you put this in a script in ServerScriptService, it will work.