Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Help with ContextActionService BindAction?

Asked by
Dorx86 0
8 years ago

I have been trying to make my game mobile suppeoted by making the player jump high as pc players. It works on pc when i emulate my device on ipad, but then when i got to my mobile device the buttons dont work as a "nil" error

01local contextActionService = game:GetService("ContextActionService")
02local player = game.Players.LocalPlayer
03local char = player.Character
04 
05function JumpHigh()
06    char.Humanoid.JumpPower = 100
07    char.Humanoid.Jump = true
08    char.Humanoid.JumpPower = 50--I dont know why this doesnt work on mobile but works on pc
09end
10 
11contextActionService:BindAction("jump", JumpHigh, true, "j")--Mobile bindaction
12contextActionService:SetTitle("jump", "Super Jump")--the title of the button
1
have you considered that humanoid may not exist in certain times. Also I would use Enum.KeyCode.J instead of "j" Angels_Develop 52 — 8y
0
Oh i see, thnx Dorx86 0 — 8y

Answer this question