Sorry I haven't long woken up and I know it's probably an easy fix but I can't for the life of me think straight...
local TpLocations = game:GetService("Workspace"):WaitForChild("TeleportFolder")
--DoesTheMagic
local function TeleportPlayer(HitPart)
if HitPart.Parent:FindFirstChild("Humanoid") then
print("A user has touched a TP: ".. HitPart.Parent.Name)
end
end
--FireFunctionOnTPTouch
for _,v in pairs(TpLocations:GetChildren()) do
if v:IsA("BasePart") then
v.Touched:Connect(TeleportPlayer)
end
end
I'm creating a folder which stores all Teleport Pads in the same location. On touch of any Teleport Pad, I would like it to print which Player has touched the Teleport Pad but also display which Teleport Pad has been touched.
Eg.
"A user has touched a TP: xXTouchOfFrostXx" "Teleport Location: _______ "
Any ideas?
Thank you :)
