well; keep in mind that anything that touches the part will cause the Touched() event to fire,
therefore, you should check to see whether the the touching part is a part of the player's character; and here is how you can do it..
function onTouch(part)
local parent = part.Parent
local players = game.Players
if parent:FindFirstChild("Humanoid") and players:FindFirstChild(parent.Name) then
game.StarterGui.ScreenGui.Frame.LocalScript.Disabled = false
end
end
script.Parent.Touched:Connect(OnTouch);
so the above code checks whether the parent of the touching part has a humanoid, and whether it has an associated player object; if so then it has ensured that the touching part is a limb of a player; remember that, the function provided to the Touched() event with Connect() is called with the touching part, this way so you know which part is touching;
for example: if i have a part and that part is touched by another part named "touching", then if i did the following it should print "touching" in output
function onTouch(touching)
print(touching.Name)
end
1 comment
Nice screenshots. Especially the last one. 10/10 man.