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 8 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 8 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

local contextActionService = game:GetService("ContextActionService")
local player = game.Players.LocalPlayer

function JumpHigh()
print 'Hi'--enter ur code
end

contextActionService:BindActionToInputTypes("jump", JumpHigh, true, "j")
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.
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. 

Answer this question