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

Follow-up question to "Touching part not making BillboardGUi show up?"

1 answer

✓ Accepted answer

Error Script:

terminateArea.Touched:connect(function(hit)
	if hit.Parent:FindFirstChild("Humanoid")then
		local player = game:GetService("Players"):GetPlayerFromCharacter(hit.Parent)
		if hit.Parent:FindFirstChild("Head").TerminateGui.TerminateText.Visible == false then
			if game.Players.GetPlayerFromCharacter(hit.Parent).Team == ExecuteTeam then
			end 
			hit.Parent:FindFirstChild("Head").TerminateGui.TerminateText.Visible = true -- this line of code is supposed to be in the last "if" statement I assume
		end
	end
end)

Fixed Script:

terminateArea.Touched:connect(function(hit)
	if hit.Parent:FindFirstChild("Humanoid")then
		local player = game:GetService("Players"):GetPlayerFromCharacter(hit.Parent)
		if hit.Parent:FindFirstChild("Head").TerminateGui.TerminateText.Visible == false then
			if game.Players.GetPlayerFromCharacter(hit.Parent).Team == ExecuteTeam then
				hit.Parent:FindFirstChild("Head").TerminateGui.TerminateText.Visible = true -- Intended placement
			end
		elseif hit.Parent:FindFirstChild("Head").TerminateGui.TerminateText.Visible == true then
			if game.Players.GetPlayerFromCharacter(hit.Parent).Team ~= ExecuteTeam then
				hit.Parent:FindFirstChild("Head").TerminateGui.TerminateText.Visible = false -- make the gui invisible if the visibility is set to true and the player is not on the "execute" team
			end
		end
	end
end)

2 comments

0

It works, but on line 09 and 05 it says that it expected ":". but either way, thanks!

0

I copied the script in ur post xD, sry I didnt check properly

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