I'm making a sort of admin gui, and for some reason most of the commands are not working, the reason they're not working is because most of them use the same way to find something, which I'm pretty sure is why it's not working, but I don't know why its not working, but I do know that if this way gets fixed/someone tells me why it's not working, I'll have the rest of them fixed.
Variables not stated in code snippet:
Gui15 = a Textbutton
Holder = A model that holds stringvalues with a players name (Yes, I've checked; It has the players name.
If you can't see all of line 5 for some reason (I can't), the code for it is this:
Instance.new("ForceField",game:GetService("Players")[v.Value]:FindFirstChild("Character"))
I use :FindFirstChild and :GetService() because of possible renaming of objects, I also believe :FindFirstChild is the cause of it not working, not too sure.
Gui15.MouseButton1Down:connect(function()
for _,v in pairs(Holder:GetChildren()) do
if v:IsA("StringValue") then
if game:GetService("Players")[v.Value]:FindFirstChild("Character") then
Instance.new("ForceField",game:GetService("Players")[v.Value]:FindFirstChild("Character"))
end --It's not showing the end of the line above with the sites code block for some reason (For me at least)
end
end
end)
