✓ Accepted answer
Yes, of course, but you'll need a RemoteFunction to return whether you own the game pass from a LocalScript. The jump Bindable should also be disabled. You can also view this for some extra knowledge.
LocalScript in StarterCharacterScripts
local me = game.Players.LocalPlayer
local char = me.Character or me.CharacterAdded:Wait()
local humanoid = char:WaitForChild("Humanoid")
local RemoteFunction = script:WaitForChild('RemoteFunction')
local UserInputService = game:GetService('UserInputService')
local canJumpAndRun = RemoteFunction:InvokeServer()
local ContextActionService = game:GetService('ContextActionService')
ContextActionService:UnbindAction("jumpAction")
local maximizedWalkSpeed = 30
local defaultWalkSpeed = 16
UserInputService.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.Space then
humanoid.Jump = (canJumpAndRun and true or false)
elseif input.KeyCode == Enum.KeyCode.LeftShift then
humanoid.WalkSpeed = (canJumpAndRun and maximizedWalkSpeed or defaultWalkSpeed)
end
end)
UserInputService.InputEnded:Connect(function(input)
if input.KeyCode == Enum.KeyCode.LeftShift then
humanoid.WalkSpeed = defaultWalkSpeed
end
end)
In a Script inside of the LocalScript
local RemoteFunction = Instance.new("RemoteFunction", script.Parent)
local GamePassService = game:GetService('GamePassService')
local GamePassId = 100000
function RemoteFunction.OnServerInvoke(player)
return GamePassService:PlayerHasPass(player, GamePassId)
end
4 comments
what...
http://wiki.roblox.com/index.php?title=Game_pass c:
Are you saying I wrote it wrong? I'm not even sure what I did wrong, thanks if you get back to me
^ Nah, just a reference. :P