Server script not firing on :FireServer( )

ive been trying to make a script where you press a gui button and it spawns a bus. for some reason, it worked before but now it wont. heres my code:

heres the fire-part of the local script:

game.ReplicatedStorage.spawns.RemoteEvent:FireServer()
print("remote event fired")
script.Parent.Parent.Parent:Destroy()

and heres the whole server script inside the remote event:

script.Parent.OnServerEvent:Connect(function(plr)
	print("remote event activated")
	local bus = game.ServerStorage.buses.bus1:Clone()
	bus.Parent = workspace.buses
	bus.chassis.Anchored = false
	bus:SetPrimaryPartCFrame(CFrame.new(-13, 13, 5))
	bus.Name = plr.Name
end)

but in the output only “remote event fired” comes up and not “remote event activated”.

all help is appreciated :smile:

Hi, is the script inside the remote event? If so I don’t think that scripts run in Replicated Storage so you may want to try moving the script to ServerScriptStorage and changing the ‘‘script.Parent.OnServerEvent’’ to something like ‘‘ReplicatedStorage.spawns.OnServerEvent:Connect(function(plr)’’

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.