Im trying to make a forsaken-like game, ive made mobile controls and now copying those simple scripts over for this script and tweaking it to work better with PC .
Problem is that its not detecting when the mouse is clicked, help please
wait(0.1)
local Animator = workspace:FindFirstChild(script.Parent.Parent.Parent.Parent.Parent.Name):FindFirstChildOfClass("Humanoid"):FindFirstChildOfClass("Animator")
local Cooldown = script.Parent.Parent.Cooldown
local Animation = script.Parent.Parent.Animation
game.UserInputService.InputBegan:Connect(function(input: InputObject, gameProcessedEvent: boolean)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
if Animator then
if Cooldown.Value == 0 then
wait(0)
Cooldown.Value = 2
local anim = Animator:LoadAnimation(Animation)
anim:Play()
local anim = Animator:LoadAnimation(Animation)
anim:Play()
Animator.Parent.Parent:FindFirstChild("KickboxScript").Enabled = true
wait(0.1)
Animator.Parent.Parent:FindFirstChild("KickboxScript").Enabled = false
else
print("Failed2")
end
else
print("Failed")
end
end
end)