im trying to make shift lock not able to be turned on when player is seated because its binding over my code and i want shift lock to be able to be turned on when player is unseated
code
01 | local Seats = { |
02 | workspace [ "Model [2] Alpha Series of Class: Paired Dual Main Battery Station" ] .Seat, |
03 | workspace [ "Model [2] Bravo Series of Main Battery Class " ] .Seat, |
04 | workspace [ "Model [3] Charlie Series of Main Battery Class " ] .Seat |
05 | } |
06 | for i, Seat in pairs (Seats) do |
07 | local RemoteEvents = game.ServerStorage [ "Begin[N]End" ] |
08 | local ReplicatedStorage = game:GetService( "ReplicatedStorage" ) |
09 | local ServerStorage = game:GetService( "ServerStorage" ) |
10 | local SeatProperty = Seat.Occupant |
11 |
12 | Seat.Changed:Connect( function (Properties) |
13 | local function OnSEAT(Player) |
14 | if SeatProperty ~ = nil then |
15 | RemoteEvents.Parent = ReplicatedStorage |
You did not define a player with the OnSEAT() function. You just did OnSEAT() without any porperties.
01 | local plr = game.Players.LocalPlayer |
02 | local Seats = { |
03 | workspace [ "Model [2] Alpha Series of Class: Paired Dual Main Battery Station" ] .Seat, |
04 | workspace [ "Model [2] Bravo Series of Main Battery Class " ] .Seat, |
05 | workspace [ "Model [3] Charlie Series of Main Battery Class " ] .Seat |
06 | } |
07 | for i, Seat in pairs (Seats) do |
08 | local RemoteEvents = game.ServerStorage [ "Begin[N]End" ] |
09 | local ReplicatedStorage = game:GetService( "ReplicatedStorage" ) |
10 | local ServerStorage = game:GetService( "ServerStorage" ) |
11 | local SeatProperty = Seat.Occupant |
12 |
13 | Seat.Changed:Connect( function (Properties) |
14 | local function OnSEAT(Player) |
15 | if SeatProperty ~ = nil then |
I'm assuming it's in a LocalScript.
problem fixed
01 | --local Seats = |
02 | -- { |
03 | -- workspace["Model [A]"].Seat, |
04 | -- workspace["Model [B]"].Seat, |
05 | -- workspace["Model [C]"].Seat, |
06 | -- workspace["Model [X]"].Seat, |
07 | -- workspace["Model [Y]"].Seat |
08 | -- } |
09 |
10 | --local PlayersService = game:GetService("Players") |
11 |
12 | --PlayersService.PlayerAdded:Connect(function(Player) |
13 | -- for index, Seat in pairs(Seats) do |
14 | -- Seat.Changed:Connect(function(Property) |
15 | -- if Seat.Occupant ~= nil then |