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

How to call a RemoteFunction to the Client with a ClickDetector?

Asked by
TofuBytes 500 Moderation Voter
9 years ago

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

A regular Inside a part in the Workspace with a ClickDetector:

local clickDetector = script.Parent.ClickDetector

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

Local script 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

1 answer

Log in to vote
0
Answered by 9 years ago

Read this thread, it may help with your question; http://wiki.roblox.com/index.php?title=RemoteFunction_and_RemoteEvent_Tutorial Also, Roblox broke the coding for GUIs, so that also may be why your script isn't working.

0
Ah, I didn't know the GUIs were broken. Thanks for the help! TofuBytes 500 — 9y
0
No problem, glad to help. ;) TheeDeathCaster 2368 — 9y
Ad

Answer this question