I'm having problems with this script, Idk if im suppose to add a team and add the team color or what but I really need help please respond.
local plr = script.Parent.Parent.Parent.Parent.Parent.Parent -- Ascends the heirarchy and assigns a local variable to the player owning this GUI
script.Parent.MouseButton1Click:connect(function() -- Activates when the GUI is clicked without the mouse leaving the button
if plr:IsInGroup(755417) then -- Checks if the player is in UAF - Group ID is 80738
plr.TeamColor = game.Teams["Dark Assault Forces"].TeamColor -- If so, their Team colour is changed to the UAF Team colour
local char = plr.Character.Humanoid -- Assigns a local variable to the players characters Humanoid
if char then -- Checks if the character exists
char.Health = 0 -- Sets the humanoid health to 0 (Kills them)
end
end
end)
I tried it and all it does is not change my team here's the order: http://prntscr.com/8q107o

6 comments
You probably need to create a team called "Dark Assault Forces"
try using plr:GetMouse()..... if im correct MouseButton1Click doesnt work. It should be mouse.Button1Click
@kollkid8099 MouseButton1Click works fine
It needs to be MouseButton1Down.
You can't click a ScreenGui, you can only click a TextButton, ImageButton, anything else classified as a button.
Instead of trying to click the ScreenGui, try this: script.Parent.Frame.Frame.DAF.MouseButton1Click I am not sure what you are trying to accomplish here.