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

My remote event for my shop doesn't work. Can someone explain why?

This is normal script:

local rp = game:GetService("ReplicatedStorage")
script.Parent.Triggered:Connect(function(player)
	print(player)
	rp.shopactivate:FireClient(player)
end)

This is local script in player scripts:

local rp = game:GetService("ReplicatedStorage")
rp.shopactivate:OnClientEvent(function(player)
	player.PlayerGui.Shop.ImageLabel.Transparency = 1
end)

The first script works but not the local script. I get the error "OnClientEvent is not a valid member of RemoteEvent "ReplicatedStorage.shopactivate""

1 comment

0

You can't use player gui's using a local script

3 answers

✓ Accepted answer

OnClientEvent is not a function of the Remote Event, rather it's an RBXScriptSignal (event)

--bad
rp.shopactivate:OnClientEvent(function(player)
--good
rp.shopactivate.OnClientEvent:Connect(function(player)

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