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

"- Ram is not a valid member of Workspace" How can I fix that?

Hello! I want to make an animation when equipped, for a test I made "print("Hello")" When I'm picking up the tool it says "Ram is not a valid member of Workspace" How can I fix that?

--Ram is a tool in a workspace

--Script: local function animation() game.Workspace.Ram.Equipped:Connect(function(mouse) print("A tool was equiped") end)

end animation()

3 comments

0

print("A tool was equipped")

0

is ram in the workspace?

0

do you mean like ram as in how much ram the users device has on hand? I do not know for sure but I'm almost positive that you cant know that with the studio

1 answer

✓ Accepted answer

I'm assuming you are using a local script? Local Scripts can only be run in certain places and the workspace is not one of them (unless it's in the player's character).

You can find out where they can run here.

Solution 1

Place the local script inside the tool and run Tool.Equipped using script.Parent to get the tool object.

script.Parent = Tool

script.Parent.Equipped:Connect(function()

end)

Solution 2

Make the script or local script stay in a place where it can only run once. That way it isn't re-running game.Workspace.Ram again (because once you pick the tool up it isn't parented to workspace anymore, rather it is parented to the character).

This can be in Player.PlayerScripts if it's a Local Script. game.Workspace or game.ServerScriptService if it is a Server Script

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