Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why does my Gate w/ Health not take damage, or work?

Asked by
Lefryn 20
9 years ago

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.

2 answers

Log in to vote
1
Answered by
parkderp1 105
9 years ago

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.

0
Thank you good sir, i give you cookie if i ever meet you. :D Lefryn 20 — 9y
0
I just edited it. parkderp1 105 — 9y
0
Please accept my answer if you felt it was what you were looking for :) parkderp1 105 — 9y
Ad
Log in to vote
-3
Answered by 9 years ago

post the script

1
There is a 'comment' feature -- don't post answers that aren't actual answers. This isn't a forum. Perci1 4988 — 9y
0
I do what I want TimeTicks -2 — 9y

Answer this question