idk how to name this post
the first player can see other player trail even when i didnt activate it yet
im very bad at scripting tho
--extracted script
repeat wait() until game.Players.LocalPlayer.Character
local UserInputService = game:GetService("UserInputService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local char = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()
local humanoid = char:WaitForChild("Humanoid")
local PressedMouseButton = ""
local Equipped = false
local Combo = 0
local Debounce = false
local SoulsInputDelayTime = 0.1
local Trail = script.Parent["Arming Sword"].Trail
Trail.Enabled = false
local Tip = script.Parent["Arming Sword"].Tip
Tip.Enabled = false
local Idle = humanoid:LoadAnimation(script.Parent.Animation.Idle)
local Open = humanoid:LoadAnimation(script.Parent.Animation.Open)
local Close = humanoid:LoadAnimation(script.Parent.Animation.Close)
local L1 = humanoid:LoadAnimation(script.Parent.Animation.L1)
UserInputService.InputBegan:Connect(function(input, gpe)
if input.UserInputType == Enum.UserInputType.MouseButton1 then -- Left mouse button
PressedMouseButton = "LEFT"
script.Parent:Activate()
elseif input.UserInputType == Enum.UserInputType.MouseButton2 then -- Right mouse button
PressedMouseButton = "RIGHT"
script.Parent:Activate()
end
end)
local function ActivateTrail(Length, DelayTime)
wait(DelayTime)
Trail.Enabled = true
Tip.Enabled = true
wait(Length)
Trail.Enabled = false
Tip.Enabled = false
end
script.Parent.Equipped:Connect(function()
Open:Play()
Open.Stopped:wait()
Equipped = true
Idle:Play()
end)
script.Parent.Activated:Connect(function()
if PressedMouseButton == "LEFT" then
if Combo == 0 and Debounce == false then
wait(SoulsInputDelayTime)
humanoid.AutoRotate = false
humanoid.WalkSpeed = 0
Debounce = true
L1:Play()
spawn(function()ActivateTrail(0.35, 0.15)end)
Combo = Combo + 1
L1.Stopped:Wait()
humanoid.AutoRotate = true
humanoid.WalkSpeed = 16
Debounce = false
end
elseif PressedMouseButton == "RIGHT" then
print("rightmouse didnt do anything (Yet)")
end
end)
script.Parent.Unequipped:Connect(function()
Equipped = false
Idle:Stop()
Close:Play()
Close.Stopped:wait()
end)