Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to make a remote event in replicated storage using a script?

local q = Instance.new("RemoteEvent")
	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

2 answers

✓ Accepted answer

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.

local q = Instance.new("RemoteEvent")
q.Name = "q" --It HAS to be a string
q.Parent = game.ReplicatedStorage --You're setting the parent of the remote event

9 comments

0

Edit: Just made some unnecessary edits.

0

@Dovydas1118 I suggest parenting it FIRST to prevent errors.

0

@Dovydas1118 I suggest parenting it FIRST to prevent errors.

0

@Dovydas1118 I suggest parenting it FIRST to prevent errors.

0

@Dovydas1118 I suggest parenting it FIRST to prevent errors.

0

@Dovydas1118 I suggest parenting it FIRST to prevent errors.

0

ok stop spamming me

0

Ohmygod I'm so sorry! I didn't mean to spam! I Accidentally clicked the "Post" button too many times!

0

It's no problem. Anyways, thanks for the info. I'll make sure to parent it first.

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:

local remoteEvent = Instance.new("RemoteEvent") --variable that's not a single letter to make it less confusing
remoteEvent.Parent = game.ReplicatedStorage --you ALWAYS want to parent the RemoteEvent first to prevent any errors
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.

1 comment

0

ok ill try

This discussion is preserved as it was. New answers, comments, and votes are closed.