1 | local q = Instance.new( "RemoteEvent" ) |
2 | q.Name = q |
now i know how to make a remote even although i have no clue how to give it a destination for example make a remote event in replicated storage
pls help
First of all, your remote event name has to be a string. Secondly, there's 2 options to set the parent. You can use the 2nd parameter of Instance.new()
which is the parent of the script. It is deprecated however, so I do not suggest using it. Instead use q.Parent
after making the Instance.
1 | local q = Instance.new( "RemoteEvent" ) |
2 | q.Name = "q" --It HAS to be a string |
3 | q.Parent = game.ReplicatedStorage --You're setting the parent of the remote event |
You forgot to parent the instance. You see, if an instance (any object, like RemoteEvents) has no parents, it won't appear.
I would type it like this:
1 | local remoteEvent = Instance.new( "RemoteEvent" ) --variable that's not a single letter to make it less confusing |
2 | remoteEvent.Parent = game.ReplicatedStorage --you ALWAYS want to parent the RemoteEvent first to prevent any errors |
3 | remoteEvent.Name = "remoteEvent name here" |
Also, next time when you post, try and make it more descriptive. It was kind of hard for me to read and understand.