Hello ! I want to make it so that when the player sits on the seat, the player's camera moves to a share called "Camera1". But I have a problem with the remoteEvent passing from server to client. Apparently, the client does not detect the "FireAllClients" at the remoteEvent. Here is my code:
Server Script :
--The script is into "ServerScriptService"
local Seat = game.Workspace.World.SGC.SeatDHD.Seat
local RemoteEvent = game.ReplicatedStorage.SeatDhd
Seat.Changed:Connect(function()
if Seat.Occupant ~= nil then
local Player = game.Players:GetPlayerFromCharacter(Seat.Occupant.Parent)
RemoteEvent:FireAllClients(Player.Name)
end
end)
Local Script :
--The script is in the Seat
local Seat = script.Parent
local RemoteEvent = game.ReplicatedStorage.SeatDhd
local Camera = workspace.CurrentCamera
local Camera1 = workspace.CameraSeat
RemoteEvent.OnServerEvent:Connect(function(Player)
if Player == game.Players.LocalPlayer.Name then
Camera.CameraType = Enum.CameraType.Scriptable
Camera.CFrame = Camera1.CFrame
end
end)
