I am attempting to make a VIP tp script, so that when a player with VIP touches the door, it will tp them to the position of the VIP room. Though this does not work, all it does is print out, 'Not a valid Player' on line 6.
Here is my script:
local gamepassId = 1109268370
function onTouch(hit)
local player = hit.Parent
local torso = player:FindFirstChild("Torso")
if game:GetService("GamePassService"):PlayerHasPass(player, gamepassId) then
torso.CFrame = CFrame.new(script.Parent.Parent.VIPPlatform.Position)
wait()
else
return false
end
end
script.Parent.Touched:Connect(onTouch)
Any help is appreciated, thanks.

2 comments
Oh, that worked perfectly! Thanks!
You're very welcome! :)