So im making a admin panel and theres a button to teleport to players and this script automaticlly starts for some reason even tho i didnt click the button for it to start im still a starter can someone please help me~~~~~~~~~~~~~~~~~ if script.Parent.MouseButton1Click then local p1 = game.Players.LocalPlayer.Character.HumanoidRootPart local p2 = "InsertPlayerHere"
local pos = p1.CFrame
p2 = script.Parent.Parent.Player.Text
p1.CFrame = game.Players[p2].Character.HumanoidRootPart.CFrame
p1.CFrame = pos
end

2 comments
if script.Parent.MouseButton1Click then local p1 = game.Players.LocalPlayer.Character.HumanoidRootPart local p2 = "InsertPlayerHere" local pos = p1.CFrame p2 = script.Parent.Parent.Player.Text p1.CFrame = game.Players[p2].Character.HumanoidRootPart.CFrame p1.CFrame = pos end
You can't use If for Signal, you have to use connection. also if the text isn't a player's name then the script will error