Joshua
1
Hello, I made Horror game and Elevator, and I need to detect How much Players standing in the part(with Number) I need script to detect How much Players standing in the part that really Help for me
is this how u do it?
local Players_In_Area = 0
local plrs = {}
script.Parent.Touched:Connect(function(plr)
local char = plr:FindFirstAncestorWhichIsA("Model")
if not plrs[char.Name] then
if game.Players:FindFirstChild(char.Name) then
plrs[char.Name] = 0
Players_In_Area += 1
end
end
end)
script.Parent.TouchEnded:Connect(function(plr)
local char = plr:FindFirstAncestorWhichIsA("Model")
if plrs[char.Name] then
if game.Players:FindFirstChild(char.Name) then
plrs[char.Name] = nil
Players_In_Area -= 1
end
end
end)
Noah
4
I can’t guarantee that, did you test it on roblox?
If you find a post on the devforum like you did, I would recommend testing it before trying it out here!
Joshua
5
I’ve tried it but I don’t know how to test if it’ll work
Noah
6
What do you mean by this?
Joshua
7
Its alright ill just try to find another way
Noah
8
It’s okay, just I don’t think I understand by what you mean.
system
Closed
10
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.