I am working a build system for my game but ContextActionService just wont work.
It wont print anything when i press E not even an error.
Here is the problematic code.
local ContextActionService = game:GetService("ContextActionService")
function handleAction(actionName, inputState, inputObject)
if actionName == "PlaceObject" and inputState == Enum.UserInputState.Begin then
print("Test")
end
end
ContextActionService:BindAction("PlaceObject", handleAction, true, Enum.KeyCode.E)
I am really not sure what I did wrong here, I have been trying to fix this for the last 3 hours.
Archivable means it can be cloned > The starterpack isnt where tools/scripts are for the player > they get cloned into the players backpack. If it was false it wouldnt be able to clone over.
Show the properties of the problem script > if theres nothing wrong the only logical reason is another script you have is deleting the script or disabling it. As I said I already threw it into studio and it works perfectly fine. You can probably open a new studio and try that script there just to see if some script you currently have is problematic.
All types of loops will stop the code below it from running since the script is repeatedly running the loop. Also, if the loop ends then the code below it will start to run. Another way you can fix this is by just moving the loop script to the bottom of the script.