Good Midnight Fellas!
Making a plugin for Emergency Vehicle Creator, which doesn’t matter for this forum post. What I am posting about is that doing .OnServerevent and :FireServer isn’t working at all. Keep in mind this is for A-Chassis, so it’s not the same as popping a remote event in replicated storage and having a script in serverscriptservice.
I attached an image below of how A-Chassis is structured mid-server. A-Chassis rearranges the structure of everything in-game, so the hierarchy is different from studio to game.
Server Script under the remote event
--------------------------------------------------------------------------------
-- Variables --
--------------------------------------------------------------------------------
local FireClick = script.Parent
local Lightbar = script.Parent.Body.Lightbar
--------------------------------------------------------------------------------
-- Main --
--------------------------------------------------------------------------------
FireClick.OnServerEvent:Connect(function()
print("PLEASE WORK")
end)
Local Script under the A-Chassis interface element
--------------------------------------------------------------------------------
-- Variables --
--------------------------------------------------------------------------------
local Car = script.Parent.Car.Value
local FireClick = Car.FireClick
local ELS_1 = script.Parent.EVC_UIAddon.ELS_1
local ELS_2 = script.Parent.EVC_UIAddon.ELS_2
local ELS_3 = script.Parent.EVC_UIAddon.ELS_3
local Siren_MAN = script.Parent.EVC_UIAddon.Siren_MAN
local ELSStage = 0
--------------------------------------------------------------------------------
-- Debugging Functions --
--------------------------------------------------------------------------------
function PrintELSStage()
print("Player has attempted to fire ELS Stage"..ELSStage..". Attempting to send to controller handler.")
end
--------------------------------------------------------------------------------
-- ELS Stage Buttons --
--------------------------------------------------------------------------------
ELS_1.MouseButton1Up:Connect(function()
ELSStage = 1
FireClick:FireServer(ELSStage) -- Sets the ELSStage variable to whatever, which is sent to the handler and sets the stage from there.
PrintELSStage()
end)
ELS_2.MouseButton1Up:Connect(function()
ELSStage = 2
FireClick:FireServer(ELSStage)
PrintELSStage()
end)
ELS_3.MouseButton1Up:Connect(function()
ELSStage = 3
FireClick:FireServer(ELSStage)
PrintELSStage()
end)
Thanks!
Edit: You have to scroll down on the “ELS Stage Buttons” comment and then you’ll find the :FireServer event. Also before you ask, I just removed the arguments from the Server Script and the main function that occurs once the remote event gets fired.