Hello. This might be the wrong category. Let me know. Anyways, I’m currently designing a system in which a player selects a button on a computer that will give them access to a specific door. What I hope to accomplish is that when the player makes their choice on the computer, the hitbox in front of the door can only be touched by the player who made the selection. When the hit box is touched, the door will swing open, allowing the player to go through. So basically, my question would be: Is it possible to modify the CanTouch
property of a part only for the player that made the selection on a computer screen via a LocalScript
?
1 Like
You could check if the part touching the CanTouch part, is from the local player’s character
(Not required if the localscript creates the part in question before hand.)
I recommend trying, or messing around with spatial queries for the hitbox
namely GetPartBoundsInBox, or GetPartBoundsInRadius
-
player presses button → remote event fired from the localscript telling which door was selected → server script receives the remote and creates a attribute in the player which has the value of which door can be opened.
-
door hitbox is touched → script checks if its a player and if that player has the attribute for that specific door → door opens
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.