:FireServer and .OnServerEvent not working | A-Chassis Plugin

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.

image

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.

A Script is a Lua code container that can access server-side objects, properties, and events, such as to award badges to players using BadgeService, while LocalScripts on the client cannot.

The instant that the following conditions are met, a script’s code is run in a new thread:

I know what a script and a local script does, i’m pretty confused by how this is supposed to help.

The local script detects when a player clicks on a UI element, then does a :FireServer event.
The server script detects when a :FireServer occurs and fires whatever, for example a print statement.

You have the script in the wrong location.

This is A-Chassis, the script would work fine. A-Chassis handles script locations differently than regular scripts.

The script location isn’t a problem once so ever.

Edit: On A-Chassis, you would make a local script, a remote event under the local script, and then a script under that remote event. Sounds weird to a normal scripter but that’s how it works.

Hi ,
the only thing I can think of that could be causing this problem is that local script is not enabled.

can you send ss from:
Players->[user name]->PlayerGui->A-Chassis Interface

It is indeed enabled, but here’s the screenshot!
image

Also sorry for such a late response, been busy.

Gonna bump this post due to still needing assistance.

Still need assistance! Script doesn’t work.

Edit: Turns out it was a combo of things, including instead of script.Parent.Parent.Parent I did script.Parent.Parent