Value being weird?

Hey there! I’m making a game but something odd is happening when i am trying to do something. So basically, i would like the Cooldown value to be modified as there’s multiple abilities and the system works well, but the local script is not working.

local UIS = game:GetService("UserInputService")
local plr = game.Players.LocalPlayer
local rs = game.ReplicatedStorage
local remote = rs.Ability.AbilityRemote
local Debounce = false
local CD = script:FindFirstChild("CD")
local Ability = plr.PlayerGui.Main.Ability.Ability
UIS.InputBegan:Connect(function(key)
	if Debounce == false then
	if key.KeyCode == Enum.KeyCode.E then
			remote:FireServer(plr, Ability)
			Debounce = true
			wait (0.1)
			wait (CD.Value) -- where the bug happens.
			Debounce = false
		end
	end
end)

Image:
image

Could somebody help?

1 Like

I already fixed it, no problem.

1 Like

if you don’t mind answering, what was the solution?

I removed the value from CD.Value and put the variable for it right above it

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.