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

Gui pull up still not working???

Asked by 9 years ago

I've read and did what RoboFrog told me to do on the last question, but my script is still not working.

game.Workspace.JimmyTheBlacksmith.Torso:connect(function(hit)
    -- Code goes here
local plr = game.Players.LocalPlayer
function PullUpGuiOnClick()
game.Workspace.JimmyTheBlacksmith.Torso:connect() -- This part was edited
game:GetService("InsertService"):LoadAsset(185218430).Parent = plr.PlayerGui

game.Workspace.JimmyTheBlacksmith.Torso:connect() PullUpGuiOnClick()
end

end)

is the script I currently have.

Thanks for reading!

1 answer

Log in to vote
1
Answered by
RoboFrog 400 Moderation Voter
9 years ago

Like I stated previously, "InsertService" will be more laggy than a pre-created GUI in StarterGui. It makes the game much more dependent on the ROBLOX servers as well, which will cause a plethora of issues.

Assuming what you're trying to spawn in with it is a GUI, you could just insert that and place it into StarterGui. Then, use hit.PlayerGui.GUINameHere.FirstFrame.Visible = true, where GUINameHere is the name of your GUI, and FirstFrame is the name of the frame which holds everything else (assuming only one frame is doing this; multiple will require this being done for each direct child of GUI).

You can completely get rid of line 8 and 5, since 1 handles all of the calling you will need. You could also get rid of line 4 and 9, since they serve no visible purpose.

EDIT:

local plr = game.Players.LocalPlayer

game.Workspace.JimmyTheBlacksmith.Torso:connect(function(hit)
    hit.PlayerGui.GUINameHere.FirstFrame.Visible = true -- Read above on how to modify this.
end)

With this code, you will also want to decide how you want the GUI to become visible = false. My suggestion would be placing a block into the doorway, that when touched, finds the GUI inside the player and changes its visibility to false. (it doesn't matter much if its already off, as long as you add a debounce)

0
What "doorway" are you talking about??!! my game only has this man standing on a baseplate. TroytheDestroyer 75 — 9y
0
Also, that pull up gui is still not working. my script is: game.Workspace.JimmyTheBlacksmith.Torso:connect(function(hit) TroytheDestroyer 75 — 9y
0
hit.PlayerGui.BluesteelBow.main.Visible = true end) TroytheDestroyer 75 — 9y
0
This was assuming that it was in a building. The important part of this is the block being placed in the theoretical doorway. And have you added the GUI to the StarterGui yet? RoboFrog 400 — 9y
0
umm ya i added the gui into startergui. i'll make it so you can see whats inside later. and i'm making him on a stand. TroytheDestroyer 75 — 9y
Ad

Answer this question