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

Why is this not working? [SOLVED]

local event = script.Parent:WaitForChild("SortOilRigData")

event.OnClientEvent:connect(function()
local data = game.ReplicatedStorage.RemoteFunctions.GetData:InvokeServer()
print(data.dataone)
print(data.datatwo)
end)

Hi guys - any ideas why I get the erorr? OnClientEvent is not a valid member of LocalScript

I am waiting for a RemoteEvent to be inserted into the BackPack - it has never errored before :( Any ideas? Thanks.

1 answer

Apparently, script.Parent.SortOilRigData is a LocalScript instead of a RemoteEvent. Are you sure about your hierarchy?

2 comments

0

Yeah, I'm sure! :/ I do this: Player:WaitForChild("Backpack") local event = Instance.new("RemoteEvent") event.Parent = Player.Backpack event.Name = "SortOilRigData" wait(2) event:FireClient(Player)

0

OH! never mind - fixed it! :D Thanks anyway ;)

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