So basically, I have a local script running inside a tool to play an animation and fire a remote event whenever I click and have the tool equipped, but instead what happens is that if I click and the tool isn't equipped, it fires the remote event. Could someone tell me why?
local UIS = game:GetService("UserInputService")
local plr = game.Players.LocalPlayer
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Attack = ReplicatedStorage:WaitForChild("OnAttackSword")
local char = plr.Character
UIS.InputBegan:Connect(function(input, event)
if input.UserInputType == Enum.UserInputType.MouseButton1 and script.Parent.Equipped then
print("OK")
game.ReplicatedStorage:FindFirstChild("OnAttackSword"):FireServer(char)
script.Parent.Parent.Humanoid.WalkSpeed = 9
local animation = plr.Character.Humanoid:LoadAnimation(script.Parent.Attack1)
animation:Play()
wait(1.3)
script.Parent.Parent.Humanoid.WalkSpeed = 16
end
end)

4 comments
But what about the script.Parent.Equipped on line 9?
You cant use .Equipped because it is an event..
Still confused, I did the script changes and the same problem is happening. Dont know if im just being stupid
Actually wait nevermind, It was something wrong on my end, thank you so much