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

0

You probably need to create a team called "Dark Assault Forces"

0

try using plr:GetMouse()..... if im correct MouseButton1Click doesnt work. It should be mouse.Button1Click

0

@kollkid8099 MouseButton1Click works fine

0

It needs to be MouseButton1Down.

0

You can't click a ScreenGui, you can only click a TextButton, ImageButton, anything else classified as a button.

1

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.