local uis = game:GetService("UserInputService")
local timeevent = game.ReplicatedStorage.Events:WaitForChild("timeAbility")
local tool = script.Parent
local isEquipped = false
local function timeEvent()
uis.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.E then
timeevent:FireServer()
end
end)
end
tool.Equipped:Connect(function()
isEquipped = true
timeEvent()
end)
tool.Unequipped:Connect(function()
isEquipped = false
print("Tool Not Equipped")
end)
#why is this doing legit nothing
1 messages · Page 1 of 1 (latest)
Well uh
First of all variables are case sencative
You did timeevent and then timeEvent rhey r not rhe same
Second if thats a remote event
i already have a script for if the remote is fired and it works
if i have a tool out the input will work
but if i dont it doesnt
Wai i didint read the code fully mb 😭
yh i think its cause it only runs the timeEvent function once
Yea also dont forget to disconect and reconect the uis
i lowk dont know how or where to do that
i have an idea
like tool.Unequipped:Connect(function()
then it disconnects the uis
but in
tool.Equipped:Connect(function()
then reconnect it
or sum
idk
So you want the event to fire when the player presses E with the tool equipped?