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

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

Asked by 3 years ago

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.

0
Where's the script located? Inside the GUI? Or the part? Techyfied 114 — 3y

1 answer

Log in to vote
1
Answered by 3 years ago

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

click.PlayerGui.EventText.PickUpEvent:FireClient(click, toolname, 0.02)
0
Thanks. It works! MrOinkerzYT 87 — 3y
Ad

Answer this question