I’m working on making an F3X sandbox-type game. I do not know how to script so I had to do some research to get these scripts listed below, I want it so players cannot move/delete/edit other players which would be fixed by locking all the players who join. These are 2 separate “Scripts” that are in StarterPlayer > StarterCharacterScripts.
For some reason this isn’t working, I am not sure if it’s because of the F3X tool itself or maybe the script isn’t written properly. I am not sure as I am not a scripter and know nothing about scripting.
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
for i,v in pairs(char:GetChildren())do
if v:IsA('BasePart') or v:IsA('MeshPart') then
v.Locked = true
end
end
end)
end)
Put this into a script in ServerScriptService. It’ll work for both r6 and r15 or should at least.
Are you sure that didnt work, because I just tested it and it worked fine? Did you try to put other things in the script with it? Just put that script in serverscriptservice. In a script > not a local script, not a module script > a regular script.
Well see the script works, the other scripts you have are interfering with it. Cuz I just check I know for a fact it works lmao. So you need to go through and look at that tool script because its the problem at hand. Something you could add to the script is checking to see if its a player instead of trying to lock everything inside the model itself.
Just checked, the player is getting locked its just the F3X tool can still select it for some reason… I also added a part to the baseplate thats locked and it can select the locked part
You have to go into the f3x code and find the select script and put an if statement thats asks if the parent of the part selected is a player.
I can’t really help anymore because I don’t know where the script is
Use a remote event or function (remote function if you want some feedback) and some sanity checks so the player can be locked both in the server and the client without exploiters locking players for fun.
Also note that doing .Locked will not lock a player as said, this is for studio use so you cannot click on the object while editing. I’m not sure exactly what you mean by ‘locked’ so Ill take it as keeping the player in a position without moving.
However, the way I lock a player in position is by anchoring them. The only necessary thing to do is just to get the HumanoidRootPart and anchor it.
You should try messing around with the code provided by @GorillaWeb, not sure exactly how you would make it so you can drag someone’s character smoothly on a client.