#Part is not getting tweened instead the Gui is

1 messages · Page 1 of 1 (latest)

timber jackal
#
local chest = game.Workspace:WaitForChild("Chest")
local chestHealth = chest:WaitForChild("Health")
local tweenService = game:GetService("TweenService")


game.ReplicatedStorage.EggHatchingRemotes.ChestEvent.OnServerEvent:Connect(function(plr)
    chest.Health.Value -= plr.Values.Multiplier1.Value
    chest.SurfaceGui.Frame.TextLabel.Text = chestHealth.Value.." / 1000"
    if chestHealth.Value <= 0 then
        tweenService:Create(chest, TweenInfo.new(0.1), {Size = Vector3.new(0,0,0)}):Play()
        wait(1)
        chest:Destroy()
        
    end
end)
#

the chest is a part

#

pls anyone help

#

im stuck at this issue which should be easy

solar grotto
#

u are litteraly tweening the text of the gui

#

..

timber jackal
#

@solar grotto

#

i dont think i am where am i doing tha

#

t

solar grotto
#

just tween the part instead

#

ts:Create(part, info, {Size = somesize}):Play()

timber jackal
#

do u know how how to make the boss chest respawn?

#
local chest = game.ServerStorage:WaitForChild("Chest")
local chestHealth = chest:WaitForChild("Health")
local tweenService = game:GetService("TweenService")
local chestHealthMax = 1000
local clonedChest = chest:Clone()
local mesh = chest:WaitForChild("Mesh")


game.ReplicatedStorage.EggHatchingRemotes.ChestEvent.OnServerEvent:Connect(function(plr)

    
    chest.Health.Value -= plr.Values.Multiplier1.Value
    chest.SurfaceGui.Frame.TextLabel.Text = chestHealth.Value.." / 1000"
    chest.SurfaceGui.Frame.TextLabel.Size = UDim2.new(chestHealth.Value / chestHealthMax, 0,1,0)

    if chestHealth.Value <= 0 then
        chest.SurfaceGui.Enabled = false
        tweenService:Create(mesh, TweenInfo.new(0.2), {Scale = Vector3.new(0,0,0)}):Play()
        wait(1)
        chest:Destroy()

        wait(5)

        clonedChest.Parent = game.Workspace



    end
end)
#

cuz when im doing this

#

the Cloned chest doesnt work

#

cuz it looks for the click detector of the original one'

#

this is the client side ```lua
local chest = game.ServerStorage:WaitForChild("Chest")
local player = game.Players.LocalPlayer
local chestHealth = chest:WaitForChild("Health")
local mouse = player:GetMouse()
local chestClickDetector = chest.ClickDetector

chestClickDetector.MouseClick:Connect(function()
game.ReplicatedStorage.EggHatchingRemotes.ChestEvent:FireServer()
end)

worthy briar
# timber jackal do u know how how to make the boss chest respawn?
local chest = game.ServerStorage:WaitForChild("Chest")
local chestHealth = chest:WaitForChild("Health")
local tweenService = game:GetService("TweenService")
local chestHealthMax = 1000
local mesh = chest:WaitForChild("Mesh")


game.ReplicatedStorage.EggHatchingRemotes.ChestEvent.OnServerEvent:Connect(function(plr)

    
    chest.Health.Value -= plr.Values.Multiplier1.Value
    chest.SurfaceGui.Frame.TextLabel.Text = chestHealth.Value.." / 1000"
    chest.SurfaceGui.Frame.TextLabel.Size = UDim2.new(chestHealth.Value / chestHealthMax, 0,1,0)

    if chestHealth.Value <= 0 then
        chest.SurfaceGui.Enabled = false
        tweenService:Create(mesh, TweenInfo.new(0.2), {Scale = Vector3.new(0,0,0)}):Play()
        wait(1)
        chest:Destroy()

        wait(5)
        local clonedChest = chest:Clone()
        clonedChest.Parent = game.Workspace



    end
end)```
#

try that

timber jackal
#

bc the chest when destroyed a new one comes

#

and the variables should tkae up the new chests