Hello,just for further info,this is an alt account i used because i didnt remember my password on my main acc.
So,I was trying to make a player when it clicks on a GUI button,it creates a clone of it and passes it to all players in the server.I havent figured it out yet and its driving me crazy! Also tried some dev forum solutions,still nothing.
I have tested it out with a binable event and remote event (Not sure if i need to use a Remote Function) In the binable event,it works,but it only appears to the player who pressed it
I am using a remote event:
Local
local UIS = game:GetService("UserInputService")
local plr = game.Players.LocalPlayer
local mouse = plr:GetMouse()
local Erase = script.Parent.Parent:WaitForChild("Erase")
local Send = script.Parent.Parent:WaitForChild("Send")
local point = script.Parent:FindFirstChild("Pointer")
local canvas = script.Parent
local hold = false
function paint(X, Y)
local gui_X = canvas.AbsolutePosition.X
local gui_Y = canvas.AbsolutePosition.Y
local offset = Vector2.new(math.abs(X - gui_X), math.abs(Y - gui_Y - 36))
point.Position = UDim2.new(0, offset.X, 0 , offset.Y)
if hold == false then return end
local pixel = point:Clone()
pixel.Name = "Pixel"
pixel.Parent = canvas
end
Erase.MouseButton1Click:Connect(function()
local children = canvas:GetChildren()
for i, child in pairs(children) do
if child.Name == "Pixel" then
child:Destroy()
end
end
end)
canvas.MouseMoved:Connect(paint)
canvas.MouseEnter:Connect(function()
point.Visible = true
end)
canvas.MouseLeave:Connect(function()
point.Visible = false
end)
UIS.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
hold = true
end
end)
UIS.InputEnded:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
hold = false
end
end)
--script.Parent.Parent, player.Name
Send.MouseButton1Click:Connect(function(player)
game.ReplicatedStorage.RemoteEvents.ShareEvid:FireServer(player)
script.Parent.Parent.Draw.Visible = false
script.Parent.Parent.Send.Visible = false
script.Parent.Parent.Erase.Visible = false
script.Parent.Top.Visible = false
end)
game.ReplicatedStorage.RemoteEvents.ShareEvid.OnClientEvent:Connect(function(player)
local Gui = plr.PlayerGui.Evidence.Draw:Clone()
Gui.Top.Text = plr.Name.."'s Evidence"
Gui.Parent = player
return Gui
end)
Yes,it is a canvas GUI.
Server
game.ReplicatedStorage.RemoteEvents.SetOrder.OnServerEvent:Connect(function()
local Teams = game.Teams
for i, v in pairs(Teams.Innocent:GetPlayers()) do
local Char = v.Character
Char.HumanoidRootPart.CFrame = workspace.InnoTP.CFrame
end
for i, v in pairs(Teams.Blamed:GetPlayers()) do
local Char = v.Character
Char.HumanoidRootPart.CFrame = workspace.BlameTP.CFrame
end
workspace.Separate.CanCollide = true
wait(8)
workspace.Separate.CanCollide = false
end)
--The part up is another thing,recommend to not pay attention to it
game.ReplicatedStorage.RemoteEvents.ShareEvid.OnServerEvent:Connect(function(player)
for _, player in pairs(game:GetService("Players"):GetPlayers()) do
game.ReplicatedStorage.RemoteEvents.ShareEvid:FireClient(player)
end
end)
And a bonus:Top is not a valid member of ScreenGui? While its parented to the draw frame.
If you could include example code it would be better
Sorry,i am not that good in scripting. Thanks,Have a nice day.

3 comments
It didnt worked,still,it shows nothing,but thanks for at least trying
what is the error you are getting?
It doesnt print any error