not printing anything, script:
local tr = true
local Player = game.Players.LocalPlayer
local Tool = script.Parent
local Script = script
local Animation = Tool:WaitForChild("HitAnim1")
local HoldAnim = Tool:WaitForChild("HoldAnim")
local Character = Player.Character or Player.CharacterAdded:Wait()
local Hit1 = Character:FindFirstChildOfClass("Humanoid"):LoadAnimation(Animation)
local Hold = Character:FindFirstChildOfClass("Humanoid"):LoadAnimation(HoldAnim)
local PlayerEquiped = script.Parent.Parent.Parent
local Players = game:GetService("Players")
Tool.Equipped:Connect(function()
Hold:Play()
end)
Tool.Activated:Connect(function()
if tr == true then
Hit1:Play()
script.Parent.Slash:Play()
tr = false
wait(0.5)
tr = true
end
end)
Tool.Unequipped:Connect(function()
Hold:Stop()
end)
Tool.Hitbox.Touched:Connect(function(hit)
print("touched", hit)
if hit.Parent:FindFirstChild("Humanoid") then
-- It's a player
local otherPlayer = Player:GetPlayerFromCharacter(hit.Parent)
if otherPlayer then
if otherPlayer.Team.Name ~= Player.Team.Name then
print(otherPlayer.Name, "is not on the same team.")
end
end
end
end)
pictures containing the parts and stuff
video of me using it:
team script (just in case this has anything to do with it)
local teams = game:GetService("Teams"):GetChildren()
local team1 = game.Teams.Blue
local team = game.Teams.Red
local teamtrue = false
game.Players.PlayerAdded:Connect(function(player)
if teamtrue == false then
if player.Team == nil then
player.Team = team
teamtrue = true
end
end
if teamtrue == true then
if player.Team == nil then
player.Team = team1
teamtrue = false
end
end
end)