How would I detect if a player is inside a certain room? - without using magnitude, as magnitude has a "circular" type of detection, I tried using magnitude but it wouldn't count the player inside the room if the player was in a corner. What do I use to accomplish this?
Hello. I will be helping you, please read everything carefully. This will be like a tutorial.
First I have questions my self.
Does you game only have 1 building? 1 Room?
Anyway, how I would do this is insert a script to ServerScriptService. Type this code in:
game.Players.PlayerAdded:connect(function(player) local PlayerStatus = Instance.new("Folder") PlayerStatus.Parent = player PlayerStatus.Name = "Storage" local InRoom = Instance.new("BoolValue") InRoom.Parent = PlayerStatus InRoom.Name = "InRoom" InRoom.Value = false end)
Now I would add a part, make sure part settings are Anchored, can collide false and transparency = 1
Add Touch Function
local part = script.Parent part.Touched:connect(function(Hit) if Hit.Parent:WaitForChild("Storage").InRoom = false then -- Do what you need to do end end)
Sorry this is kinda rushed because I had to leave (or else a made mob would have killed me)
Try it out and make sure you change the InRoom value. If InRoom value is true then it means the player is touching the part.
Make sure to accept answer and Upvote if helped.
If you have any questions or comments or anything to say comment and I will get back to you.