I have been trying to make a car spawn ui, but the remote event isn’t working
I have a local script in a textbutton in startergui with this code:
script.Parent.MouseButton1Click:Connect(function()
game.ReplicatedStorage.CarSpawnEvent:FireServer(script.Parent.Name)
print(game.Players.LocalPlayer.Name.." Triggered Car Spawn Event")
end)
I also have a remote event in replicatedstorage called CarSpawnEvent
Lastly i have a server script in server script service with this code:
game.ReplicatedStorage.CarSpawnEvent.OnServerEvent(function(Car)
local CloneCar = game.ReplicatedStorage.Cars:FindFirstChild(Car)
if not CloneCar then
print("Error")
else
print("Sucsess")
CloneCar = CloneCar:Clone()
CloneCar.Parent = workspace.Cars
end
end)
In the output, i get ‘Bloxer126g triggered car spawn event’ but not ‘sucsess’ or ‘error’