I have this problem can anyone help me plz here is my code
local TeleportService = game:GetService("TeleportService") local part = script.Parent part.Touched:Connect(function(hit) local human = hit.Parent:FindFirstChild("Humanoid") if human then local char = hit.Parent local player = game.GetPlayerFromCharacter(hit.Parent) TeleportService:Teleport(7092017722, player) end end)
line 10: "local player = game.GetPlayerFromCharacter(hit.Parent)" is wrong
GetPlayerFromCharacter is a function of the player service, not game which is a DataModel.
and most functions use the colon (:) operator and not the dot (.) operator
so replace
local player = game.GetPlayerFromCharacter(hit.Parent)
with
local player = game:GetService("Players"):GetPlayerFromCharacter(hit.Parent)