✓ Accepted answer
This is supposed to be a LocalScript since you're using Players.LocalPlayer, which in this case, you can have the notification fire locally without having to use RemoteEvents.
If you want to fire the server for some reason, use ReplicatedStorage.notification:FireServer(argument).
local plr = game:GetService('Players').LocalPlayer
repeat wait() until plr and plr.Character and plr.Character:FindFirstChild('Humanoid')
local char,hum = plr.Character,plr.Character.Humanoid
local UIS = game:GetService('UserInputService')
local ReplicatedStorage = game:GetService('ReplicatedStorage')
UIS.InputBegan:Connect(function(input,event)
if input.KeyCode == Enum.KeyCode.E and hum.Sit == true then
if hum.SeatPart ~= nil and hum.SeatPart.Name == 'SomeSeatName' then
print('you're sitting on a specific seat!")
--this returns the Part itself, so you can check if it's a specific color or such
end
--not sure what you're doing here, but you can't fire client from a local script
--make this notification happen on the client instead of through an event
print("you're sitting and pressing a key!")
end
end)
2 comments
This works in every seat, so anybody can anchor the ship if they're sitting in a seat, is there a way to edit this so that if they're sitting in a specific seat, and only a specific seat it works?
i made an edit