im currently working on a roleplay game and i want to make some parts of my game with keybinds like to open close, lock and knock on the door.
Im currently using for that a local script inside the playergui that checks the distance between humanoidrootpart and the door. Also its a global script this is what i call it because it uses a tag system so i just have to add the certain part into the tag and boom it works.
However to get the door open i use a fireevent to server and i realized that exploiters could just fire the event themselves. How would i make the distance checked between player and the tag on the server ?
No, I mean pass the door object as an argument of :FireServer() and have It check the distance on the server. Your other problem is easily fixed by checking if the HumanoidRootPart exists before doing anything. for example: