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

Hello? Anyone? Please Help Me With This. I'm Willing To Make A Deal With The Devil At This Point!

Asked by
kuru226 13
2 years ago
Edited 2 years ago

Hello, so I am trying to make a script that it sees if the parent's text is "90", if so, it will make the humanoid's health also 90. I'm just a girl trying to code for my friends over here.

here it is:


while true do wait(.15) print("Testing") if script.Parent.Text == "90" then script.Parent.Parent.Parent.Parent.Humanoid.Health = 90 end end

it doesn't show any errors or anything like that in the output. Please help! please ask any questions, Thanks!!

0
oh so ur a girl  >:) imKirda 4491 — 2y
0
you are saying it does not even print "Testing"? This means that code does not run at all, where is the script located? imKirda 4491 — 2y
0
Did you by any chance put the script into a StarterCharacter? I may be able to help you with this if so. luluziluplayzROBLOX 61 — 2y
0
no, @luluziluplayzROBLOX, I didn't put it in a starter character. I put it in a textlabel that shows the character what the number is. kuru226 13 — 2y
View all comments (3 more)
0
oops, sorry for the confusion, @imKirda. I checked and it does print "Testing" but nothing after that, I'm so confused :( kuru226 13 — 2y
0
Try adding an if statement. luluziluplayzROBLOX 61 — 2y
0
@luluziluplayzROBLOX, wdym? i did add an if then statement? kuru226 13 — 2y

1 answer

Log in to vote
0
Answered by 2 years ago
Edited 2 years ago

If you've put the script into a StarterCharacter model, this may not work.

Usually, when you insert a script into a StarterCharacter, when you start the game and check the Explorer, the script is deleted.

One thing you can do is put the script somewhere else, such as the Workspace, then use the Instance:Clone function to duplicate the script whenever someone joins the game, and then use .Parent to change the parent of each new script so that the script is in the new player's model.

Please tell me if it works or not!

Edit: Since you have a GUI, try using an if statement.

0
can I show you a screenshot or something? Im new to this site heh kuru226 13 — 2y
0
Sure! you can just give me a link to the image. luluziluplayzROBLOX 61 — 2y
Ad

Answer this question