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

this dueling system isnt working?

Asked by 8 years ago
Edited 8 years ago

how would one make a system that when you challenge a player a gui would be sent to them, and a somewhat of a duel would begin?

i Started with this:

local Players = game.Players:GetChildren()
function click()
for i, v in pairs(Players) do
if v.Name == script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Name then
game.ReplicatedStorage.DuelGui:Clone().Parent = v
end
end
end
script.Parent.MouseButton1Click:connect(click)`
0
Please use a code block xxxXMrsAwesomeXxxx 70 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

In order for players to be able to see a GUI, it has to be located in the PlayerGui. So to do so, you'd clone the GUI and put it into the v value's PlayerGui.

local Players = game.Players:GetChildren()
function click()
for i, v in pairs(Players) do
if v.Name == script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Name then
game.ReplicatedStorage.DuelGui:Clone().Parent = v.PlayerGui
end
end
end
script.Parent.MouseButton1Click:connect(click)`

Ad

Answer this question