of     1   

buildmodel
#155393867Friday, February 06, 2015 12:21 AM GMT

How would I change this hint to GUI? I want the GUI to be only seen when they are on touched with them. function Touched(hit) m = Instance.new("Hint") m.Parent = game.Workspace m.Text = ("WARNING: Shield Defences Online") wait(1) m:Remove() e = Instance.new("Explosion") e.Parent = game.Workspace e.Position = hit.Position e.BlastPressure = 10 e.BlastRadius = 5 end script.Parent.Touched:connect ("Touched")
nixpc
#155397054Friday, February 06, 2015 1:02 AM GMT

m.Parent = hit.Parent
buildmodel
#155404441Friday, February 06, 2015 2:40 AM GMT

If I was weather to change it to a GUI instead of a hint would it be. script.frame.clone() Did i do this correct?
buildmodel
#155408085Friday, February 06, 2015 3:29 AM GMT

Help, I am stuck.
Goulstem
#155408342Friday, February 06, 2015 3:32 AM GMT

Clone a premade gui into the player's playerGui. Say you have a gui in ServerStorage named 'TestGui'? Edit accordingly local guiName = 'TestGui' local gui = game.ServerStorage:FindFirstChild(guiName) script.Parent.Touched:connect(function(hit) local plr = game.Players:GetPlayerFromCharacter(hit.Parent) if plr then if gui then gui:Clone().Parent = plr.PlayerGui end end end)
buildmodel
#155408948Friday, February 06, 2015 3:41 AM GMT

Okay like this? function Touched(hit) local guiName = 'TestGui' local gui = game.ServerStorage:FindFirstChild(guiName) script.Parent.Touched:connect(function(hit) local plr = game.Players:GetPlayerFromCharacter(hit.Parent) if plr then if gui then gui:Clone().Parent = plr.PlayerGui e = Instance.new("Explosion") e.Parent = game.Workspace e.Position = hit.Position e.BlastPressure = 10 e.BlastRadius = 5 end script.Parent.Touched:connect (Touched)
Goulstem
#155409844Friday, February 06, 2015 3:54 AM GMT

No, assuming 'TestGui' is valid.. dis. local guiName = 'TestGui' local gui = game.ServerStorage:FindFirstChild(guiName) script.Parent.Touched:connect(function(hit) local plr = game.Players:GetPlayerFromCharacter(hit.Parent) if plr then if gui then gui:Clone().Parent = plr.PlayerGui e = Instance.new("Explosion",workspace) e.Position = hit.Position e.BlastPressure = 10 e.BlastRadius = 5 end)
buildmodel
#155455446Saturday, February 07, 2015 12:29 AM GMT

Okay , thank you for helping What does his line do? local guiName = 'TestGui'
buildmodel
#155455844Saturday, February 07, 2015 12:35 AM GMT

:/
bloxx97
#155463014Saturday, February 07, 2015 2:20 AM GMT

Essentially GUIs work a lot like functions where you need to create them (and for that matter do not need to create them live while the server is running, but can do it personally in studio mode) and then move them into the player's PlayerGui when the Event triggers your function. For a GUI to make messages, you're actually going to have to create a GUI that mimics personal messages. Gonna have to create the background, make it black and semi-transparent, and then add a Text Box to it, and then have the GUI's text and background disappear after a few seconds or at the click of a GuiButton that looks like X. GUIs are a pain in the ass. I bet there's a plugin that allows you to drag and drop GUI elements so that you don't have to do all the manual positioning like in the good old days. http://wiki.roblox.com/index.php?title=API:Class If you scroll down to GUI, there's a list of a few GUI classes and then a massive list of Events. If you mean you want them to only see the hint-like GUI when they are physically touching the Part/block/brick/button and then NOT see it when they move off of it - you can use the TouchStarted and TouchEnded Events instead of Touch. And for what it's worth - this is the actual Touched event syntax pulled from the wiki. function onTouch(obj) script.Parent.Transparency=0.8 script.Parent.CanCollide=false wait(2) script.Parent.Transparency=0 script.Parent.CanCollide=true end script.Parent.Touched:connect(onTouch) --as in no quotes when you call your function with connect at the end. --However you've taught me something because I had trouble understanding the event handler (hit). I thought this script was cheese until I searched around to find the event handler refers to the Part that is touched. Because really in my mind I would just set the explosion to script.Parent - why would anyone even refer to the same brick in two different ways if the script is already in the Part that it wants to listen to?

    of     1