- What do you want to achieve? Keep it simple and clear!
I was learning how to use RemoteEvents, and set up a test that should spawn a red part.
- What is the issue? Include screenshots / videos if possible!
When I start the game, I get this error:
Here is my code:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RemoteEvent = ReplicatedStorage:WaitForChild("RemoteEventTest")
local function onCreatePart(player, partColour, partPos)
print(player.Name .. " fired the remote event")
local newPart = Instance.new("Part", workspace)
newPart.BrickColor = BrickColor.new(partColour)
newPart.Position = partPos
end
RemoteEvent.OnServerEvent:Connect(onCreatePart())
- What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I noted that I had an error with the BrickColor, fixed that, and it still did not spawn the part.
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
That is about it, if you want the LocalScript that fires the event, I will happily post it for you.