I have been searching around for the way of checking if a player is in a part or touching it, the part has collision off.
Example would be for PartA , run script , is the player in or touching PartA
I also looked at some resources like ZonePlus etc (which from what I see is a trigger event: enter exit, verses being able to query what zone / part a player is in currently.
And the player might be not moving inside of the part, ie kickn it, so an ENTERED trigger cannot be used because they might have entered it awhile ago…
local Part = "Your Part Here"
Part.Touched:Connect(function(hit) -- hit Variable to detect items
local Hum = hit.Parent:FindFirstChild("Humanoid") -- Finds Players Humanoid
if Hum then
print("Player Detected: ", tostring(hit.Parent.Name)) -- Converts Items Name to a String plus with another String
end
end)
With your reply, it is still a triggered event, meaning when the part is touched it triggers. I am not looking for a triggered event.
What I am looking for is they are doing something else, lets say clicked on a prompt, then I want inside of the prompt code (the script code I am trying to figure out)
Is the current player inside of PartA?
( I probably should have added this for more clarity.)
Yes, true, another thought I had, but I was looking for a real time check.
Also if you have a good number of parts that I am checking for at any given time ie prompt all over, they all would have to have a table for each player set up…
I think that if I I stored it in a each part (via a custom property in the part), it then becomes a server table of any player entering or exiting the part…
Perhaps their is an easier way of tracking it… I thought though reading about WorldRoot, it sound like it would work, it is just a matter of how do you loop through what it returns, and see if it is part of the players parts…
perhaps not the particular solution you are looking for as I don’t know the intricate functionalities of the module: ZonePlus functions can detect when a player enters a zone, touching? not sure.