|
| 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 |
|
|
|
| 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 |
|
|
| |
|
|
| 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 |
|
|
| |
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 26 Jul 2015 08:41 PM |
| try mine again but remove the 1 from Player |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 27 Jul 2015 03:02 PM |
| turn on your party ill try to help as best i can :) |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
| |
|