Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I fix "RemoteEvent is not a valid member of ReplicatedStorage"?

Asked by 5 years ago

I am trying to make an animation play when I click using my tool I have created. I have two scripts. One script is a local script. It is inside the tool, which is inside the starterpack. Here is the script:

script.Parent.Activated:Connect(function()
    game.ReplicatedStorage.RemoteEvent:FireServer(2063032185)
end)

The second script is a regular script inside of the Workspace. Here it is:

game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(player,animationID)
    local animation = Instance.new("Animation")
    animation.AnimationId = "http://www.roblox.com/Asset?ID="..animationID

    local loadedAnimation = game.Workspace[player.name].Humanoid:LoadAnimation(animation)
    loadedAnimation:Play()
end)

According to the tutorial I watched, this should load my animation. When I click using the tool, in the output I get the error message "RemoteEvent is not a valid member of Replicated Storage". Can anyone help fix my problem?

2 answers

Log in to vote
2
Answered by 5 years ago

The RemoteEvent doesn't exist in ReplicatedStorage. It's probably in a folder or another object.

1
Or maybe he has two events named "RemoteEvent" kittonlover101 201 — 5y
0
We figured out that I never created a RemoteEvent in the first place :P TopTomYT 2 — 5y
Ad
Log in to vote
0
Answered by 5 years ago

Hmmmm, you could also use

game.ReplicatedStorage:WaitForChild("RemoteEvent"):FireServer()

WaitForChild is always important!!

0
not necessarily User#19524 175 — 5y
0
waitforchild can act like a normal function and get the child, or act as a yield function and yield the current thread until the child is returned. if the child isn’t found and the second argument isnt specified, it errors User#19524 175 — 5y

Answer this question