A simple teleporting touch function HOWEVER it only works once, when another player touches it. It doesn't teleport them...?
local Part = script.Parent Part.Touched:Connect(function(hit) local Player = game.Players:GetPlayerFromCharacter(hit.Parent) if Player ~= nil then local tele = game:GetService("TeleportService") local gameID = 5791125484 if Player.leaderstats.Tickets.Value >=1 then local gui = script.Parent.TPmessage gui:Clone() gui.Parent = Player.PlayerGui Player.leaderstats.Tickets.Value = Player.leaderstats.Tickets.Value - 1 tele:Teleport(gameID, Player) end end end)
need help ASAP considering this is the main function of the game!
instead of doing
local gui = script.Parent.TPmessage gui:Clone()
do
local gui = script.Parent.TPmessage:Clone()
When you clone, you are just cloning the GUI, whatever you do to that variable you set is not to the clone, but to the original.