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

go easy on me I just started a couple days ago, why won't good print?

local tool = script.Parent local Cooldown = script.Cooldown.Value local animation = script.swing

tool.Activated:Connect(function() local humanoid = tool.Parent:FindFirstChildWhichIsA('Humanoid')

if humanoid and Cooldown == false then
	Cooldown = true
	local playA = humanoid:LoadAnimation(animation)
	playA:Play()
	script.Parent.sharp.Damage.Disabled = false
	wait(.30)
	playA:Stop()
	script.Parent.sharp.Damage.Disabled = true
	wait(.2)
Cooldown = false
	
	
end

end)

local player = script.Parent.Parent.Parent local Pteam = player.Team

if Pteam == Red then

print("good")

end

1 comment

0

What are the errors/error

1 answer

Make sure next time you get everything into the code block.

Anyways, so I can see you are using an 'if then' statement to assess if Pteam is red, then the script with print "good". If you are trying to find the team COLOR, you must use the "TeamColor" value that is apart of the "Team" instance's properties.

local tool = script.Parent 
local Cooldown = script.Cooldown.Value
local animation = script.swing

tool.Activated:Connect(function() local humanoid = tool.Parent:FindFirstChildWhichIsA('Humanoid')

if humanoid and Cooldown == false then
Cooldown = true
local playA = humanoid:LoadAnimation(animation)
playA:Play()
script.Parent.sharp.Damage.Disabled = false
wait(.30)
playA:Stop()
script.Parent.sharp.Damage.Disabled = true
wait(.2)
Cooldown = false
	end
end)
local player = script.Parent.Parent.Parent 
local Pteam = player.Team.TeamColor

if Pteam == "Really red" then --I used Really red because I'm assuming you are using the really bright red color.
	print("good")
end

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