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

Why is this script keep resetting me?

Asked by 10 years ago

I put a script where when I say open or something, it would open the door. Well, when I did, it keeps resetting me everytime I say something. This is what the script says:

print("Gui Closer Located and initiated.") --This worked

local function onClicked(GUI) --Before, you didn't use 'GUI'
if GUI then --This checks if 'GUI' exists
GUI:Destroy() --This will Destroy the 'GUI'
end --This ends the code block for the 'if' statement
end --This ends the code block for the function

script.Parent.MouseButton1Down:connect(function() --This will, eh, I forgot, but this will connect the Event to the function
onClicked(script.Parent.Parent.Parent) --When the TextButton is clicked, it'll destroy the GUI
end) --This ends the code block for the Event/function

`

0
By "it keeps resetting me" do you mean that you die and respawn? ChiefWildin 295 — 10y
0
Yes User#5689 -1 — 10y

1 answer

Log in to vote
0
Answered by 10 years ago

Because the script you've posted does not contain any material that has to do with:

1) The Health or MaxHealth Humanoid properties or 2) The Character's body parts or 3) The Character at all

It can be accurately concluded that your issue has nothing to do with the posted script. If you've added anything to your game recently that even remotely affects the above listed items, edit the OP and post them.

Also, in order to make your post not sloppy, simply press the Code Block button above the text box when editing a post and copy/paste the code straight from the Roblox Studio Script Editor.

Otherwise, people down-rate the post and it affects not only your reputation, but MINE AS WELL. SO FIX IT.

Ad

Answer this question