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

How do I call a RemoteFunction in a ClickDetector? [Unanswered]

Asked by
TofuBytes 500 Moderation Voter
10 years ago

I've been trying to call a brick inside of the Workspace to display a GUI on the character with RemoteFunctions and FilteringEnabled. I've been attempting to find a way, but I haven't. I also tried RemoteEvents, but I might've not used them correctly either. Is there a way I can get these scripts to work? I have a RemoteFunction named 'Opened_Shop' inside of ReplicatedStorage. Please help?

Inside a Workspace brick:

local clickDetector = script.Parent.ClickDetector

clickDetector.MouseClick:connect(function(player)
    function game.ReplicatedStorage.Opened_Shop.ClientInvoke(player)
    end
end)

Inside the Client's Gui with a Frame:

function game.ReplicatedStorage.Opened_Shop.OnClientInvoke(player)
script.Parent.ShopGui.Options:TweenPosition(UDim2.new(0.5,-200,0.5,-200), Out, "Sine",1, false)
end

Answer this question