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

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

Asked by 2 years ago
Edited 2 years ago

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""

0
You can't use player gui's using a local script ghostbettert 30 — 2y

3 answers

Log in to vote
0
Answered by 2 years ago

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)
Ad
Log in to vote
0
Answered by
extrorobo 104
2 years ago

try this tutorial https://www.youtube.com/watch?v=uVUCaFs4Bh4

0
that tutorial is for gui buttons not proximity prompt NeoDogez 18 — 2y
Log in to vote
0
Answered by 2 years ago

You can't access player gui's in local scripts

Answer this question