This has been bothering me a lot, So I posted earlier about a script that decreases a Gui size, but I'm having trouble finding a location where to put this in.
At the moment there is no end, and it says
17:37:17.653 - Workspace.Water2.WaterScript:87: 'end' expected (to close 'function' at line 8) near '<eof>'
I have tried putting it after every function, and it either stops the script right there, or doesn't even allow the script to work.
It could be the placement of the Gui decrease script (lines 34 - 50)
This is the script
local Tool = script.Parent;
enabled = true
function onActivated()
if not enabled then
return
end
enabled = false
Tool.GripForward = Vector3.new(0,-.759,-.651)
Tool.GripPos = Vector3.new(1.5,-.5,.3)
Tool.GripRight = Vector3.new(1,0,0)
Tool.GripUp = Vector3.new(0,.651,-.759)
Tool.Handle.DrinkSound:Play()
script.Parent.Bites.Value = script.Parent.Bites.Value + 1
Eable()
wait(3)
local character = Tool.Parent
local player = game.Players:GetPlayerFromCharacter( character )
local thirst = player.PlayerGui.Thirst
local maxthirst = 100 --create a max thirst value
local currentthirst = 100 --create a currentthirst value
local currentthirstpercent = currentthirst/maxthirst --divide currentthirst by maxthirst to create a value between 0 and 1 to represent the percentage of thirst left.
function updatebar() --a function that will update the thirst bar. run this whenever you change the thirst
local currentthirstpercent = currentthirst/maxthirst --re-divides the thirst values
thirst.BG.Bar.Size = UDim2.new(currentthirstpercent,0,1,0) --sets the size in the x of the bar to the percentage of thirst remaining
end
function drink() --example function for increasing thirst
currentthirst = currentthirst + -50 --add thirst together
if currentthirst > maxthirst then --checks to see you aren't over the max
currentthirst = maxthirst --if you're over the max it sets you to the max
end
function updatebar() --updates the bar because you changed the value of thirst
end
Tool.GripForward = Vector3.new(-.976,0,-0.217)
Tool.GripPos = Vector3.new(0.03,0,0)
Tool.GripRight = Vector3.new(.217,0,-.976)
Tool.GripUp = Vector3.new(0,1,0)
enabled = true
end
function onEquipped()
Tool.Handle.OpenSound:play()
end
function Eable()
if (script.Parent.Bites.Value) > 5 then
script.Parent:Remove()
end
end
script.Parent.Activated:connect(onActivated)
script.Parent.Equipped:connect(onEquipped)

2 comments
I personally don't know how to tab correctly, can someone give me a brief overview of tabbing?
Every time there is like a statement you know the blue bold letters like if, function, while, stuff like that, you tab the line underneath it and then put the end with no tab so it should be in line with your statement you made and it should be easier to see where it starts and finishes