Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

this dueling system isnt working?

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)`

1 comment

0

Please use a code block

1 answer

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)`

This discussion is preserved as it was. New answers, comments, and votes are closed.