Just add a bool value in them called "CanSprint" or something then create a script not local and add this
local ID = 103728213
game.Players.PlayerAdded:connect(function(plr)
local CanSprint = plr:FindFirstChild("CanSprint")
if CanSprint != nil then
if game:GetService("GamePassService"):PlayerHasPass(player, id) then
CanSprint.Value = true
end
end
end)
and if they don't just add this
local ID = 103728213
game.Players.PlayerAdded:connect(function(plr)
local CanSprint = plr:FindFirstChild("CanSprint")
if CanSprint != nil then
if game:GetService("GamePassService"):PlayerHasPass(player, id) then
CanSprint.Value = true
else
CanSprint.Value = true
end
end
end)
and in your sprint script just add before the KeyDown function
local CanSprint = plr:FindFirstChild("CanSprint")
and then after it add
if CanSprint != nil then
if CanSprint.Value == true then
end
end
And thats it!
Edit:
I would suggest using UserInputService to check for keydown its better because Mouse.KeyDown is depricated!
To use UserInputService for your thing you just do this
local UserInputService = game:GetService("UserInputService")
UserInputService.InputBegan:Connect(function(key)
if key.KeyCode == Enum.KeyCode.LeftShift then
end
end)
UserInputService.InputEnded:Connect(function(key)
if key.KeyCode == Enum.KeyCode.LeftShift then
end
end)
2 comments
Check the wiki for GamepassService:PlayerHasPass
I checked and couldn't find anything...