So I’m making a fishing game and I want that when I press “E” with UserInputService it activates the boolvalue.
But when I press “E” it doesn’t activate the boolvalue.
My script and boolvalue are in the StarterPlayerScripts
I tried looking in the DevForum but I didn’t find anything useful and tried messing around but nothing worked.
wait()
local Animation = script.Throw
local Plr = game.Players.LocalPlayer
local Char = Plr.Character
local Rod = Char.RightHand.Rod
local UIS = game:GetService("UserInputService")
local AnimationTrack = Char.Humanoid:LoadAnimation(Animation)
local ReelPose = script.ReelPose
local ReelPoseTrack = Char.Humanoid:LoadAnimation(ReelPose)
local Reel = script.Reel
local ReelTrack = Char.Humanoid:LoadAnimation(Reel)
local IsFishing = script.IsFishing
local function FishFunction()
AnimationTrack:Play()
wait(1)
ReelPoseTrack:Play()
end
if IsFishing.Value == false then
UIS.InputBegan:Connect(function(Input)
if Input.KeyCode == Enum.KeyCode.E then
IsFishing.Value = true
print(IsFishing)
FishFunction()
for i = 1,3 do
print(i)
wait(1)
ReelTrack:Play()
end
wait(3)
IsFishing.Value = false
end
end)
end
I hope you can help me!