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

Replicate tool to all clients?

Asked by 6 years ago

I am trying to put script.Parent.Parent.Preview.Frame onto a tool's SurfaceGui, then put the tool in the players backpack and have it replicate to all clients. However, the tool is invisible to other clients.

script.Parent.MouseButton1Click:connect(function()--LocalScript #1
if enabled == true then
    enabled = false
    script.Parent.Parent.Parent.Frame.LocalScript.CloseMenu:Fire()
    workspace.Main.GenerateMemeToAllClients:FireServer(game.Players.LocalPlayer, script.Parent.Parent.Preview.Frame)
end
end)
script.GenerateMemeToAllClients.OnServerEvent:connect(function(PlayerToGive, GuiToClone)
print(GuiToClone.Name)--Regular Script In Workspace
print(PlayerToGive.Name)
game.ReplicatedStorage.GenerateMeme:FireAllClients(PlayerToGive, GuiToClone)
end)
RS.GenerateMeme.OnClientEvent:connect(function(PlayerToGive, GuiToClone)
    print(GuiToClone.Name)--LocalScript #2
    print(PlayerToGive.Name)
    local Tool = game.ReplicatedStorage.Meme:Clone()
    Tool.Parent = PlayerToGive.Backpack
    local Gui = GuiToClone:Clone()
    Gui.Parent = Tool.Handle.Meme
end)

Answer this question