"playerblock" is not a valid member of Folder

I’m trying to fire a RemoteEvent called “RightEvent” inside “playerblock”, which is in the “PlayerStuff” folder.

image

And I’m trying to fire it from a LocalScript in a ScreenGUI:

image

This LocalScript says:

if script.Parent.MouseButton1Click then
	workspace.PlayerStuff.playerblock.DownEvent:FireServer()
end

However, when I test the game, output shows “playerblock is not a valid member of Folder “Workspace.PlayerStuff” - Client - RightEvent:2”.

I am aware that this might be something related to me using LocalScripts and Scripts randomly, but I don’t know much about RemoteEvents. Thanks in advance!

2 Likes
workspace:WaitForChild("PlayerStuff")

use :WaitForChild() when getting stuff from workspace

1 Like

If you didn’t already, try using WaitForChild() when defining playerblock

1 Like

I’ve already tried this, using this.

if script.Parent.MouseButton1Click then
	workspace:WaitForChild("PlayerStuff").playerblock.DownEvent:FireServer()
end

However, it still returns the same error.

1 Like

Again, it still returns the same error.

1 Like

in game where’s the playerstuff folder is locate at?

1 Like

The PlayerStuff folder is inside the Workspace.

1 Like

Howcome u are using an if statmeent for the moustbutton1click, surely you should use mouse.Button1Click or whatever, that might fix it

1 Like

Use :WaitForChild. The syntax you’re using is also wrong, you should be connecting it to an event.

Code:

script.Parent.MouseButton1Click:Connect(function()
	workspace.PlayerStuff:WaitForChild("playerblock").DownEvent:FireServer()
end)
1 Like

but is the script run on client side?