So I have a script and when you touch a part, your walk speed it supposed change if you own a gamepass, it doesnt work and IDK why, I think the error is around the end, please help
local debounce = false
function onTouch(part)
local human = part.Parent:findFirstChild("Humanoid")
if (human ~= nil) and debounce == false then
debounce = true
if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(game.Players.LocalPlayer, 7549271) then
human.WalkSpeed = 40
else
human.Walkspeed = 20
wait(1)
debounce = false
end
end
end
script.Parent.Touched:connect(onTouch)

1 comment
Indent your code please