I have a Gui that allows you to teleport to any Metro Station you want, but if you teleport to a Metro Station whilst sitting down (inside a train), the trains comes with you. Which then brakes the game.
Any way to detect if the player is sitting on any seat, then if the player attempts to teleport the Player can’t and it instead prints out an Error Message?
local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local hum = char:WaitForChild("Humanoid")
hum:GetPropretyChangedSignal("Sit"):Connect(function()
if hum.Sit == true the
--function
end
end)
Occupant:
local Seat = script.Parent -- Path to seat
Seat:GetPropertyChangedSignal("Occupant"):Connect(function()
if Seat.Occupant ~= nil then
local Char = Seat.Occupant.Parent
--function
end
end)
Seated:
local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local hum = char:WaitForChild("Humanoid")
hum.Seated:Connect(function()
--function yipee
end)