I want to make the player sit after clicking on this ui in the train that is spawned!
The issue is that the player isn’t being found!
I have tried looking on the devforum and developer section butI couldn’t find a solution
local Enabled = false
script.Parent.MouseButton1Click:Connect(function(plr)
if Enabled == false then
Enabled = true
local Mod = game.ServerStorage['90']
if workspace.DepotSpot2.Occupied.Value == false then
local clone = Mod:Clone()
clone.Parent = workspace.ActiveTrains
clone:MakeJoints()
local player = plr.Parent.Parent.Parent.Parent
clone:WaitForChild("Coach1").Drive:Sit(player.Character.Humanoid)
wait(25)
Enabled = false
elseif workspace.DepotSpot2.Occupied.Value == true then
script.Parent.Text = "Occupied"
wait(1)
script.Parent.Text = "Class 90"
end
end
end)
– This is in a normal script!