Here is the model of the gate :
http://www.roblox.com/help-pls-item?id=243199939
If you are in studio with it, put the GateGUI in startergui.
Basically, I'm having two issues with it. One, it refuses to take damage from a linked sword, and two, it doesn't edit the GUI to say what I want it to say.
I've tried moving the Humanoid, and edit the function so it'll work, however I can't get it going. What am I doing wrong here? :(
The script is within the model as well.
You never call SetupGui, so add script.Parent.Humanoid.HealthChanged:connect(SetupGUI)
to the, end of your script.
This will call your function when the humanoid's health changes, in other words it runs the function when a specific action occurs, in this case when the Humanoid's health changes.
Also you have to find the player who is damaging the gate so you can edit their gui. Right now you are editing the StarterGui which only changes the gui when the player respawns. To do this use a Touched event to call(run) a function that finds the player's Player in Players (that's a mouthful) and edits their gui, which is in PlayerGui. If you don't know how to do this just tell me :)
Finally do this to your if statements:
if diet <= --The Value you already have and diet>= --The next value you are checking for then
This gives a range of values to check so no change is skipped over.
As for gate not taking damage TakeDamage() which is used in the LinkedSword isn't working for some odd reason.