|
| 07 Aug 2017 09:19 AM |
local ReplicatedStorage = game:GetService("ReplicatedStorage") local duplicate = ReplicatedStorage:WaitForChild("duplicate") script.Parent.MouseButton1Click:connect(function() duplicate:FireServer() end)
--localscript (this one works fine)
local ReplicatedStorage = game:GetService("ReplicatedStorage") local duplicate = ReplicatedStorage:WaitForChild("duplicate") local PaintingLandscape = workspace.PaintingLandscape local pasteEvent = game.ReplicatedStorage.paste local function onClone(player) local clonepainting = PaintingLandscape:Clone() clonepainting.Name = "Canvas" clonepainting.Position = Vector3.new(TAGS) clonepainting.Parent = game.Workspace local cloneGUI = player.PlayerGui.Studio.Canvas:Clone() TAGS = "Painting" cloneGUI.Parent = game.ReplicatedStorage cloneGUI.Adornee = clonepainting pasteEvent:FireAllClients() -- this one doesn't work end
duplicate.OnServerEvent:connect(onClone)
-- serverscript
local Players = game:GetService("Players") local ReplicatedStorage = game:GetService("ReplicatedStorage") local player = Players.LocalPlayer local pasteEvent = ReplicatedStorage:WaitForChild("paste") local painting = game.ReplicatedStorage.Painting local function onPaste() local clone = painting:Clone() clone.Parent = player.PlayerGui clone.Adornee = workspace.Canvas end pasteEvent.OnClientEvent:Connect(onPaste)
-- paste event local script does not fire and idk why
Why won't the client event fire?
|
|
|
| Report Abuse |
|
|
jonesj627
|
  |
| Joined: 06 Oct 2010 |
| Total Posts: 1496 |
|
|
| 07 Aug 2017 09:36 AM |
| It's OnServerEvent in server scripts |
|
|
| Report Abuse |
|
|
|
| 07 Aug 2017 09:41 AM |
i know, that's how i have it.
|
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 07 Aug 2017 10:05 AM |
your mom is really fat, i hmp her
|
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
Exzeption
|
  |
| Joined: 01 Nov 2011 |
| Total Posts: 1312 |
|
|
| 07 Aug 2017 12:23 PM |
| i've had problems with AllClients in the past, dunno why. either we're using it wrong or it's broken and you'll just need to loop through all the players |
|
|
| Report Abuse |
|
|
|
| 07 Aug 2017 12:36 PM |
it would be hard to loop through the players with what I am trying to do. I need it to be in a local script but idk how.
pasteEvent:FireAllClients(WOULD I NEED TO PUT SOMETHING HERE? IF SO, WHAT.)
|
|
|
| Report Abuse |
|
|