Hello.. I have a problem. Im trying to make my Bus Spawner GUI Spawn a vehicle using remote event. And It works in client but it does not work on the server (with filtering enabled) Script 01
script.Parent.Veh4.MouseButton1Click:connect(function() script.Parent.SpawnRemote.Value = true end)
Thats the first script and that was sending a signal to the other script using BOOL VALUES. The script is a normal script not local. SCRIPT 02
while true do wait(0.01) if script.Parent.SpawnRemote.Value == true then game.ReplicatedStorage.Spawn:FireServer() script.Parent.Enviro200.Value = true script.Parent.SpawnRemote.Value = false end end
that script was a LOCAL SCRIPT Not a normal script. That script fire's the Remote event. Script 03
game.ReplicatedStorage.Spawn.OnServerEvent:connect(function() while true do wait(1) if script.Parent.Parent.Enviro200.Value == true then local Mod = game.ServerStorage.Enviro200 --Change test to whatever you have named the item you want to spawn local clone = Mod:clone() script.Parent.Parent.Enviro200.Value = false clone.Parent = workspace script.Parent.Parent.Visible = false end end end)
That script is when the remote event is fired and it spawns in the bus.
Im trying to make my vehicle/bus spawner gui work with filtering enabled but it's just not working on a Filtering Enabled Server. I have tried lots of ways to fix it but its just not working. Please help.
Local Script:
local ExampleEvent = game:GetService("ReplicatedStorage"):WaitForChild("Example") local GUIButton = script.Parent GUIButton.MouseButton1Down:Connect(function() ExampeEvent:FireServer() end)
Server Side:
local ExampleEvent = game:GetService("ReplicatedStorage"):WaitForChild("Example") local Car = game:GetService("ServerStorage").Bus:Clone() ExampleEvent.OnServerEvent:Connect(function(player) local vehicle = Car vehicle.Parent = game.Workspace.SpawnLocation end)
This is an example, but :FireServer() is on the client side when firing the Remote Event. OnServerEvent function goes to the server side.