starter character scripts server script:
local player = script.Parent local humanoid = player:WaitForChild("Humanoid") local playername = script.Parent.Name local playergui = game.Players:WaitForChild(player.Name).PlayerGui local sit = game.ReplicatedStorage.Sit local NoSit = game.ReplicatedStorage.NoSit while wait() do local function onSeated(isSeated, seat) if isSeated and seat.Name == "VehicleSeat" then sit:FireClient() elseif isSeated == false then NoSit:FireClient() end end end
starter gui car local script:
local Depo = game:GetService("ReplicatedStorage") local playergui = game:GetService('Players').LocalPlayer:WaitForChild('PlayerGui') local sit = Depo.Sit local NoSit = Depo.NoSit local function onSitFired() playergui.car.Frame.Visible = true end sit.OnClientEvent:Connect(onSitFired) local function onNoSitFired() playergui.car.Frame.Visible = false end NoSit.OnClientEvent:Connect(onNoSitFired)
local function onSeated(isSeated, seat) if isSeated and seat.Name == "VehicleSeat" then sit:FireClient() elseif isSeated == false then NoSit:FireClient() end end
correct me if i'm wrong but i dont think you called the function
instead try this
local player = script.Parent local humanoid = player:WaitForChild("Humanoid") local playername = script.Parent.Name local playergui = game.Players:WaitForChild(player.Name).PlayerGui local sit = game.ReplicatedStorage.Sit local NoSit = game.ReplicatedStorage.NoSit local function onSeated(isSeated, seat) if isSeated and seat.Name == "VehicleSeat" then sit:FireClient() elseif isSeated == false then NoSit:FireClient() end end while wait() do onSeated(argument1,argument2) end