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

Why is my RemoteEvent erroring? Cannot pass value onto object?

I'm trying to make a script that will make a Gui pop up on your screen when you pick up an item, and when I fire the event to make the gui script work, it tells me "value cannot be passed to object" Here's my script:

local toolname = "Test"
local tool = game.ServerStorage:FindFirstChild(toolname)

script.Parent.MouseClick:Connect(function(click)
	tool.Parent = click.Backpack
	click.PlayerGui.EventText.PickUpEvent:FireClient(toolname, 0.02)
end)

The item goes into my backpack, but the event errors.

1 comment

0

Where's the script located? Inside the GUI? Or the part?

1 answer

✓ Accepted answer

To send FireClient you need to specify the player E.G:

click.PlayerGui.EventText.PickUpEvent:FireClient(click, toolname, 0.02)

1 comment

0

Thanks. It works!

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