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

What is happening with this gui resizing script?! I've been at this for more than 2 hours!

local player = script.Parent.Parent.Parent.Parent
local playername = player.Name
local character = game.Workspace:WaitForChild("" .. playername .."")
local humanoid = character:WaitForChild("Humanoid")
local health = script.Parent.Green
local plrhealth = humanoid.Health
local plrmaxhealth = humanoid.MaxHealth
plrmaxhealth = 100
plrhealth = 100
local RunService = game:GetService("RunService")
local e = false
local e2 = 0

RunService.RenderStepped:Connect(function()
	if plrhealth < 100 then
		local damage = 100 - plrhealth
		e = true
		repeat until e == false
			health.Size.X = 0.7 - sizedown
			e2 = e2 + 1
			if e2 == damage then
				e2 = 0
				e = false
			end
		end
	end
end) -- Script error here

Error:

Expected ')' (to close'(' at line 14), got 'end'

I've been trying to fix this for a little bit more than 2 hours, researching on many different sites including Scripting Helpers and the Roblox Wiki, and I can't figure out why this is happening.

Please help me I'm loosing my sanity,

Narwhal

1 answer

✓ Accepted answer
local player = script.Parent.Parent.Parent.Parent
local playername = player.Name
local character = game.Workspace:WaitForChild("" .. playername .."")
local humanoid = character:WaitForChild("Humanoid")
local health = script.Parent.Green
local plrhealth = humanoid.Health
local plrmaxhealth = humanoid.MaxHealth
plrmaxhealth = 100
plrhealth = 100
local RunService = game:GetService("RunService")
local e = false
local e2 = 0

RunService.RenderStepped:Connect(function()
    if plrhealth < 100 then
        local damage = 100 - plrhealth
        e = true
        repeat
            health.Size.X = 0.7 - sizedown
            e2 = e2 + 1
            if e2 == damage then
                e2 = 0
                e = false
            end
        until e == false
    end
end) 

The reason it wasn't working was because you were using repeats incorrectly. You formatted them in a wrong way.

Still doesn't work? Leave a comment.

4 comments

0

oh i see what went wrong!

0

now im questioning why isn't the gui resizing down?

0

GUI sizes are actually 4 different parts. There is the X scale, X offset, Y scale, Y offset. You also can't directly edit GUI values. You need to create a new Udim. Create a new question if you want better answers, as comments are very limited.

0

okay, i understand. Thanks!

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