You can write your topic however you want, but you need to answer these questions:
- What do you want to achieve? Keep it simple and clear!
I want the text to change once - What is the issue? Include screenshots / videos if possible!
Currently it changes as many times as the player has equipped the tool - What solutions have you tried so far? Did you look for solutions on the Creator Hub?
Tried storing tools in a table but got confused and can’t find anything similar
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
local cdscreen = game.ReplicatedStorage.GUI.Core.ToolInfo:Clone()
cdscreen.Parent = plr.PlayerGui
local cdtext = cdscreen.CooldownInfo.CDText
local currenttool
local alreadyfound = {}
chr.ChildAdded:Connect(function(tool)
if tool:IsA("Tool") then
currenttool = tool
plr.PlayerGui:WaitForChild("ToolInfo").CooldownInfo.Visible = true
if tool == currenttool then
local cooldown : BoolValue = tool:FindFirstChild("Cooldown")
if cooldown then
cdtext.Visible = true
cdtext.Parent.Visible = true
if cooldown.Value == true then
cdtext.Text = "On Cooldown"
else
cdtext.Text = "Ready to use"
end
cooldown:GetPropertyChangedSignal("Value"):Connect(function()
--currently fires as many times as the player has equipped the tool
if currenttool == tool then
if cooldown.Value == true then
cdtext.Text = "On Cooldown"
else
cdtext.Text = "Ready to use"
end
end
end)
else
cdtext.Parent.Visible = false
cdtext.Visible = false
end
end
end
end)
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.