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.
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
Ok here is my example for u about CAS
01 | local contextActionService = game:GetService( "ContextActionService" ) |
02 | local player = game.Players.LocalPlayer |
03 |
04 | function JumpHigh() |
05 | print 'Hi' --enter ur code |
06 | end |
07 |
08 | contextActionService:BindActionToInputTypes( "jump" , JumpHigh, true , "j" ) |
09 | contextActionService: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. |
10 | contextActionService: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. |