Im making a script and when you say the word you grow bigger but the debounce are messing it up can get bigger multiple times breaking the game .
i tried repositioning the debounce But then when one player does it another one has to wait for the debounce .
ts = game:GetService("TweenService")
goal1 = {}
goal1.Transparency = 1
goal2 = {}
goal2.Transparency = 0
tweenInfo = TweenInfo.new(1)
local db = false
game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
if db then return end
db = true
local Humanoid = Character:WaitForChild("Humanoid")
local face = Character.Head.face
Player.Chatted:Connect(function(msg)
if msg == "maior" then
for _,v in pairs(Character:GetDescendants()) do
if (v:IsA("BasePart") or v:IsA("MeshPart") or v:IsA("Decal")) then
if v.Name ~= "HumanoidRootPart" then
ts:Create(v, tweenInfo, {Transparency = 1}):Play()
end
end
end
wait(0.3)
local HS = Humanoid.HeadScale
local BDS = Humanoid.BodyDepthScale
local BWS = Humanoid.BodyWidthScale
local BHS = Humanoid.BodyHeightScale
wait(0.3)
HS.Value = HS.Value * 3
BDS.Value = BDS.Value * 3
BWS.Value = BWS.Value * 3
BHS.Value = BHS.Value * 3
for _,v in pairs(Character:GetDescendants()) do
if (v:IsA("BasePart") or v:IsA("MeshPart") or v:IsA("Decal")) then
if v.Name ~= "HumanoidRootPart" then
ts:Create(v, tweenInfo, {Transparency = 0}):Play()
end
end
end
Humanoid.WalkSpeed = 19
wait(15)
for _,v in pairs(Character:GetDescendants()) do
if (v:IsA("BasePart") or v:IsA("MeshPart") or v:IsA("Decal")) then
if v.Name ~= "HumanoidRootPart" then
ts:Create(v, tweenInfo, {Transparency = 1}):Play()
end
end
end
wait(0.6)
HS.Value = HS.Value / 3
BDS.Value = BDS.Value / 3
BWS.Value = BWS.Value / 3
BHS.Value = BHS.Value / 3
Humanoid.WalkSpeed = 16
for _,v in pairs(Character:GetDescendants()) do
if (v:IsA("BasePart") or v:IsA("MeshPart") or v:IsA("Decal")) then
if v.Name ~= "HumanoidRootPart" then
ts:Create(v, tweenInfo, {Transparency = 0}):Play()
end
end
end
wait(8)
db = false
end
end)
end)
end)