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

Can someone explain ContextActionService to me?

Asked by 9 years ago

I want to make a script where if i'm close enough to a door, it gives the option to open it. I had this question answered already but i don't understand.

2 answers

Log in to vote
0
Answered by 9 years ago

Now I'm not going to just give you a script, but I will point you in the right direction!

The Wiki is a great place to learn about it. The Properties of ContextActionService are here, and a tutorial on how to use it is here

Ad
Log in to vote
0
Answered by
Dorx86 0
8 years ago

Ok here is my example for u about CAS

01local contextActionService = game:GetService("ContextActionService")
02local player = game.Players.LocalPlayer
03 
04function JumpHigh()
05print 'Hi'--enter ur code
06end
07 
08contextActionService:BindActionToInputTypes("jump", JumpHigh, true, "j")
09contextActionService:SetTitle("jump", "Super Jump") --This text will still appear over the image. If you don't want the text at all, you can just delete this line.
10contextActionService:SetImage("jump", "http://www.roblox.com/asset/?id=67588212";) --This line will put a picture for the button. Just change the Asset ID to any decal you'd like.

Answer this question