Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to fix this ice abilty not working if a boolvalue is true?

wait(1)
---- Services ----
local RepStorage = game:GetService("ReplicatedStorage")
local UserInputServer = game:GetService("UserInputService")

local Remote = RepStorage:WaitForChild("IceEvent")
local Player = game.Players.LocalPlayer
local Character = Player.Character
local humanoid = Character:WaitForChild("Humanoid")
-- Settings --
local Cooldown = true
local Key = "R"

UserInputServer.InputBegan:Connect(function(Input,IsTyping)
	if game.Players.LocalPlayer.leaderstats.Quirk.Value == 1 and game.Players.LocalPlayer.leaderstats.Active.Value == true then 
	if IsTyping then return end
	local KeyPressed = Input.KeyCode
	if KeyPressed == Enum.KeyCode[Key] and Cooldown and Character then
	Cooldown = false
	print("Event Fired")
	Remote:FireServer()
	wait(8)
	print("Cooldown over")
	Cooldown = true
	end
	end
	end)

I made sure the boolvalue is true But it does not give an output error and the abilty does not work When i leave the Active value out it works What am i doing wrong?

3 comments

0

You can’t store Boolean Values as a Leaderstat, I don’t believe. Try moving it within ReplicatedStorage

0

But it is only for a localplayer

0

Then store it under StarterPlayer

1 answer

To fix my issue i made a number value 1 = Quirk is on 0 means it off I learned that boolvalues dont work in leaderstats!

This discussion is preserved as it was. New answers, comments, and votes are closed.