generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Game Design
Home Search
 

Re: OnTouch ScreenGUI help

Previous Thread :: Next Thread 
CyborgDonut is not online. CyborgDonut
Joined: 06 Aug 2013
Total Posts: 733
24 Jul 2015 11:32 PM
Hi guys! Need some help with this new script I've been working on. It's suppose to pop up a screenGUI for 3 seconds then go away. I had a hard time making this script as I have no internet connection and I'm offline. And since I'm offline I don't get the features I need for this script. I know it has error and that's why I'm asking for help here. Thanks in advance!


script.Parent.Touched:connect(function(hit)
h = hit.Parent:findFirstChild("Humanoid")
if h ~= nil then
game.StarterGui.Escaped.Frame:Visible = true
game.StarterGui.Escaped.Frame.Text:Text = (hit.Parent.Name.. " has escaped!")
wait(3)
game.StarterGui.Escaped.Frame:Visible = false
end
end)
Report Abuse
8BitDeveloping is not online. 8BitDeveloping
Joined: 09 Aug 2011
Total Posts: 1472
25 Jul 2015 12:18 AM
You're just changing it in the StarterGui. Not for the actual player.
Make everything in the GUI visible and place it in, let's say Replicated Storage.

Now replace the code with this.

local reps = game:GetService("ReplicatedStorage")
local gui = reps:FindFirstChild("Escaped")

script.Parent.Touched:connect(function(hit)
h = hit.Parent:findFirstChild("Humanoid")
if h ~= nil then
local plr = GetPlayerFromCharacter(hit.Parent)
local guiclone = gui:Clone()
guiclone.Parent = plr.PlayerGui
gui.Frame.Text:Text = (hit.Parent.Name.. " has escaped!")
wait(3)
plr.PlayerGui.Escape:Destroy()
end
end)


i really really really wanna run over youuu
Report Abuse
CyborgDonut is not online. CyborgDonut
Joined: 06 Aug 2013
Total Posts: 733
25 Jul 2015 12:36 AM
Awesome! Thanks.
Report Abuse
CyborgDonut is not online. CyborgDonut
Joined: 06 Aug 2013
Total Posts: 733
26 Jul 2015 04:20 PM
Just got back and I'm receiving this error

Workspace.Part.Script:10: function arguments expected near '='

Also, this shows it to everyone in the game right?


If its round, has a hole in the middle, and it's yummy, those must be all the keywords for a perfect donut.
Report Abuse
championbuilder is not online. championbuilder
Joined: 20 Jan 2009
Total Posts: 13544
26 Jul 2015 04:43 PM
remove the brackets.
Report Abuse
CyborgDonut is not online. CyborgDonut
Joined: 06 Aug 2013
Total Posts: 733
26 Jul 2015 04:48 PM
I either understood you wrong or it doesn't work.


If its round, has a hole in the middle, and it's yummy, those must be all the keywords for a perfect donut.
Report Abuse
myactivetestplace is not online. myactivetestplace
Joined: 11 Jul 2015
Total Posts: 3733
26 Jul 2015 04:51 PM
youre putting :'s instead of .'s

try this

script.Parent.Touched:connect(function(part)
local character = game.Workspace.Player1
local player = game.Players:GetPlayerFromCharacter(character)

if player then
game.StarterGui.Escaped.Frame.Visible = true
game.StarterGui.Escaped.Frame.Text.Text =(player.Name .."Has escaped!")
wait(3)
game.StarterGui.Escaped.Visible = false


end


end)
Report Abuse
CyborgDonut is not online. CyborgDonut
Joined: 06 Aug 2013
Total Posts: 733
26 Jul 2015 07:01 PM
Doesn't work


If its round, has a hole in the middle, and it's yummy, those must be all the keywords for a perfect donut.
Report Abuse
Botchan is not online. Botchan
Joined: 14 Jun 2015
Total Posts: 269
26 Jul 2015 07:17 PM
It'll be easier to put into starterGUI and just grab it from the playerGUI by using getplayerfomcharacter as player and using player.PlayerGUI.Escpae to grab the GUI.
Report Abuse
CyborgDonut is not online. CyborgDonut
Joined: 06 Aug 2013
Total Posts: 733
26 Jul 2015 07:34 PM
Okay so it now looks like this and I know I messed up lol

script.Parent.Touched:connect(function(part)
local player = game.Players:GetPlayerFromCharacter()

if player then
player.PlayerGui.Escaped.Frame.Visible = true
player.PlayerGui.Escaped.Frame.Text.Text =(player.Name .."Has escaped!")
wait(3)
player.PlayerGui.Escaped.Visible = false


end


end)


If its round, has a hole in the middle, and it's yummy, those must be all the keywords for a perfect donut.
Report Abuse
myactivetestplace is not online. myactivetestplace
Joined: 11 Jul 2015
Total Posts: 3733
26 Jul 2015 08:41 PM
try mine again but remove the 1 from Player
Report Abuse
CyborgDonut is not online. CyborgDonut
Joined: 06 Aug 2013
Total Posts: 733
26 Jul 2015 09:10 PM
I already tried that, it didnt work


If its round, has a hole in the middle, and it's yummy, those must be all the keywords for a perfect donut.
Report Abuse
8BitDeveloping is not online. 8BitDeveloping
Joined: 09 Aug 2011
Total Posts: 1472
27 Jul 2015 11:34 AM
local reps = game:GetService("ReplicatedStorage")
local gui = reps:FindFirstChild("Escaped")

script.Parent.Touched:connect(function(hit)
h = hit.Parent:FindFirstChild("Humanoid")
if h ~= nil then
local plr = GetPlayerFromCharacter(hit.Parent)
local guiclone = gui:Clone()
guiclone.Parent = plr.PlayerGui
gui.Frame.Text.Text = (hit.Parent.Name.. " has escaped!")
wait(3)
plr.PlayerGui.Escape:Destroy()
end
end)


I love shorts! They are so comfy and easy to wear!
Report Abuse
CyborgDonut is not online. CyborgDonut
Joined: 06 Aug 2013
Total Posts: 733
27 Jul 2015 11:51 AM
It must be me or something... Would sending you the screenGui help? Because I use my knowledge of scripting (Very low.. ;( ) and I can't even fix the simple errors popping my way.


If its round, has a hole in the middle, and it's yummy, those must be all the keywords for a perfect donut.
Report Abuse
Botchan is not online. Botchan
Joined: 14 Jun 2015
Total Posts: 269
27 Jul 2015 11:56 AM


Once you got the Player's character, check for the player's humanoid. If it's not nil, clone the GUI into their playerGUI.
Report Abuse
8BitDeveloping is not online. 8BitDeveloping
Joined: 09 Aug 2011
Total Posts: 1472
27 Jul 2015 02:33 PM
local reps = game:GetService("ReplicatedStorage")
local gui = reps:FindFirstChild("Escaped")

script.Parent.Touched:connect(function(hit)
h = hit.Parent:FindFirstChild("Humanoid")
if h ~= nil then
local plr = GetPlayerFromCharacter(hit.Parent)
local guiclone = gui:Clone()
local human = hit.Parent:WaitForChild("Humanoid")
if human then
guiclone.Parent = plr.PlayerGui
gui.Frame.Text.Text = hit.Parent.Name.. " has escaped!"
wait(3)
plr.PlayerGui.Escape:Destroy()
end
end
end)



I love shorts! They are so comfy and easy to wear!
Report Abuse
CyborgDonut is not online. CyborgDonut
Joined: 06 Aug 2013
Total Posts: 733
27 Jul 2015 02:54 PM
I keep getting this error:

Workspace.Part.Script:7: attempt to call global 'GetPlayerFromCharacter' (a nil value)

I have no idea how to fix it . ):

If its round, has a hole in the middle, and it's yummy, those must be all the keywords for a perfect donut.
Report Abuse
myactivetestplace is not online. myactivetestplace
Joined: 11 Jul 2015
Total Posts: 3733
27 Jul 2015 03:02 PM
turn on your party ill try to help as best i can :)
Report Abuse
CyborgDonut is not online. CyborgDonut
Joined: 06 Aug 2013
Total Posts: 733
27 Jul 2015 04:15 PM
It's on now


If its round, has a hole in the middle, and it's yummy, those must be all the keywords for a perfect donut.
Report Abuse
CyborgDonut is not online. CyborgDonut
Joined: 06 Aug 2013
Total Posts: 733
27 Jul 2015 08:21 PM
Does this help??? :D

http://www.roblox.com/halp-item?id=276180016


If its round, has a hole in the middle, and it's yummy, those must be all the keywords for a perfect donut.
Report Abuse
CyborgDonut is not online. CyborgDonut
Joined: 06 Aug 2013
Total Posts: 733
29 Jul 2015 10:13 AM
I still cant get it to work


If its round, has a hole in the middle, and it's yummy, those must be all the keywords for a perfect donut.
Report Abuse
8BitDeveloping is not online. 8BitDeveloping
Joined: 09 Aug 2011
Total Posts: 1472
29 Jul 2015 10:20 AM
ahhh i see the problem
here this should work

local reps = game:GetService("ReplicatedStorage")
local gui = reps:FindFirstChild("Escaped")

script.Parent.Touched:connect(function(hit)
h = hit.Parent:FindFirstChild("Humanoid")
if h ~= nil then
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
local guiclone = gui:Clone()
local human = hit.Parent:WaitForChild("Humanoid")
if human then
guiclone.Parent = plr.PlayerGui
gui.Frame.Text.Text = hit.Parent.Name.. " has escaped!"
wait(3)
plr.PlayerGui.Escape:Destroy()
end
end
end)
Report Abuse
CyborgDonut is not online. CyborgDonut
Joined: 06 Aug 2013
Total Posts: 733
30 Jul 2015 11:46 PM
Thank you!


If its round, has a hole in the middle, and it's yummy, those must be all the keywords for a perfect donut.
Report Abuse
CyborgDonut is not online. CyborgDonut
Joined: 06 Aug 2013
Total Posts: 733
31 Jul 2015 11:56 PM
I'm having one problem. When they touch the brick it also respawns them and therefor the screengui doesn't pop up. I've tried adding waits and yet those don't work. Any ideas?


If its round, has a hole in the middle, and it's yummy, those must be all the keywords for a perfect donut.
Report Abuse
fualtyhellboy is not online. fualtyhellboy
Joined: 26 Aug 2012
Total Posts: 283
01 Aug 2015 12:00 AM
Frame.Visible

...
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Game Design
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image