The problem with my script its how can I Find A player when he joins without knowing his name so

script.Parent.MouseButton1Click:connect(function()
	local Player = ?
	if Player then
		local Torso = Player:FindFIrstChild("Torso")
		if Torso then
			Player.Torso.CFrame = CFrame.new(Vector3.new(-107, 0.6, 17))
		end
	end
end)

How could I make a player thing when its in game.StarterGui.TeamAdder.TeamMain.Teacher.Script and I need the player that is in the game.Workspace liekw hen you go in Play Solo its Player1 how can I find it threw a clicked function?

5 comments

0

Where is this script? Also, FindFirstChild in line 4. Not FindFIrstChild.

0

I know I made a typo and did not realise it but that script is in game.StarterGui.TeamAdder.TeamMian.Teacher.Script

0

Is 'Teacher' an ImageButton/TextButton?

0

a team

0

a textbutton sorry lol its a team and a textbutton