local userInput = game:GetService("UserInputService")
local players = game:GetService("Players")
local MarketPlace = game:GetService("MarketplaceService")
local gamepassId = 137994956
local userInput = game:GetService("UserInputService")
local players = game:GetService("Players")
local sprintSpeed = 16 -- normal default walkspeed holding no buttons
local walkSpeed = 10 -- how fast you go holding shift
local player = players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local function beginSprint(input, gameProcessed)
if not gameProcessed then
if MarketPlace:UserOwnsGamePassAsync(player.UserId, 137994956) then
if input.UserInputType == Enum.UserInputType.Keyboard then
local keycode = input.KeyCode
if keycode == Enum.KeyCode.LeftShift then
humanoid.WalkSpeed = sprintSpeed
end
end
end
end
end
--Player owns and not
local function endSprint(input, gameProcessed)
if not gameProcessed then
if MarketPlace:UserOwnsGamePassAsync(player.UserId, 137994956) then
if input.UserInputType == Enum.UserInputType.Keyboard then
local keycode = input.KeyCode
if keycode == Enum.KeyCode.LeftShift then
humanoid.WalkSpeed = walkSpeed
end
end
end
end
end
userInput.InputBegan:Connect(beginSprint)
userInput.InputEnded :Connect(endSprint)
I put it into StarterCharacterScripts
Its a local script and this is what happens when you try use it:
Do I need to wrap this into a pcall? Or change it to a normal script?
I tried to change
MarketPlace:UserOwnsGamePassAsync(player.UserId, 137994956)
to
MarketPlace:PlayerOwnsAsset(player, 137994956)
but that didnt really help.
Tysm for any help
