I have a local script in PlayerScripts, a server script in a model, and a remote event in the model.

This is the client code:

local mouse = game.Players.LocalPlayer:GetMouse()
local updating = false
local truck = game.Workspace.jihadtruck
local mouseevent = truck.MouseTruck
local fireevent = truck.FireTruck
updating = true
	repeat
		print("clntupdate")
		truck:WaitForChild("MouseTruck"):FireServer(mouse.Hit.p)
		wait(.1)
	until updating == false

This is the server code:

local mouseevent = truck.MouseTruck
mouseevent.OnServerEvent:connect(function(plr,hit)
	print("svrupdate")
end)

"clntupdate" prints but "svrupdate" does not.

I have no clue what is wrong, any help?

3 comments

0

is the server script enabled? is there a remote event canned MouseTruck?

0

its also better to include the whole script or at least the parts that explain each other

0

Just updated it. Yeah, there's a remote event in the model titled "MouseTruck". No errors are thrown when calling the function.