Eddy3D
|
  |
| Joined: 21 Nov 2010 |
| Total Posts: 3017 |
|
|
| 18 Nov 2012 06:44 PM |
funciton onTouched(h) local g = game.Workspace.GetPlayerFromCharacter local m = Instance.new("Message") m.Parent = g.PlayerGui m.Text = "Greetings" wait(3) m:Destroy end
script.Parent.Touched:connect(h)
I know that is a message when a Player touched the objec. But do anyone know what is the script for a message when I player has entered the game?
(~'3D'~) |
|
|
| Report Abuse |
|
|
MrChubbs
|
  |
| Joined: 14 Oct 2010 |
| Total Posts: 4969 |
|
|
| 18 Nov 2012 07:14 PM |
| Either use child added on Player or use a player joined function, also the script you posted doesn't work you are miss using GetPlayerFromCharacter and your connection is wrong, and you miss spelled function, and it will break if you don't add a check for g. |
|
|
| Report Abuse |
|
|
|
| 18 Nov 2012 08:03 PM |
--You don't need GetPlayerFromCharacter(), here is a fixed code:
funciton onTouched(h) local m = Instance.new("Message") m.Parent = h.Parent m.Text = "Greetings" wait(3) m:Destroy end
script.Parent.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|
|
| 18 Nov 2012 08:44 PM |
| @LUV, that puts a Message in the Part, whih would be visible to Everyone. |
|
|
| Report Abuse |
|
|
|
| 18 Nov 2012 08:47 PM |
unciton onTouched(h) local g = h:GetPlayerFromCharacter() local m = Instance.new("Message") m.Parent = g.PlayerGui m.Text = "Greetings" wait(3) m:Destroy end
script.Parent.Touched:connect(h)
|Paradoxical|
I shun thy heathen, dost thou not know that flames will devour thy mind? |
|
|
| Report Abuse |
|
|
|
| 18 Nov 2012 08:48 PM |
oops, sorry
function onTouched(h) local g = h:GetPlayerFromCharacter() local m = Instance.new("Message") m.Parent = g.PlayerGui m.Text = "Greetings" wait(3) m:Destroy end
script.Parent.Touched:connect(onTouched)
|Paradoxical|
I shun thy heathen, dost thou not know that flames will devour thy mind? |
|
|
| Report Abuse |
|
|
1Topcop
|
  |
| Joined: 09 Jun 2009 |
| Total Posts: 6635 |
|
|
| 18 Nov 2012 08:49 PM |
@Mass... no..
function onTouched(h) local g = game.Players:GetPlayerFromCharacter(h.Parent) -- This is how it's done... if(g)then local m = Instance.new("Message") m.Parent = g.PlayerGui m.Text = "Greetings" game.Debris:AddItem(m,3) end end script.Parent.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|
|
| 18 Nov 2012 08:49 PM |
oh derp sorry, It's late and I'm tired. thanks for fixing my fail though. xD
|Paradoxical|
I shun thy heathen, dost thou not know that flames will devour thy mind? |
|
|
| Report Abuse |
|
|
1Topcop
|
  |
| Joined: 09 Jun 2009 |
| Total Posts: 6635 |
|
|
| 18 Nov 2012 08:51 PM |
Just so you know, you forgot your parentheses after each Destroy method you used.
:Destroy() not :Destroy |
|
|
| Report Abuse |
|
|
|
| 18 Nov 2012 08:52 PM |
I feel so stupid now ..Lol..
|Paradoxical|
I shun thy heathen, dost thou not know that flames will devour thy mind? |
|
|
| Report Abuse |
|
|
1Topcop
|
  |
| Joined: 09 Jun 2009 |
| Total Posts: 6635 |
|
|
| 18 Nov 2012 08:52 PM |
I've messed up like that before... xD Not quite that tired yet, so I figured I'd try and help :3 |
|
|
| Report Abuse |
|
|
|
| 18 Nov 2012 11:29 PM |
I see that he wants the message to pop-up right after a player has joined the game right? Or maybe it was me who see it.
For by touching the brick:
Brick.Touched:connect(function(Toucher) local Message = Instance.new("Message",workspace) Message.Text = "Greetings O' Mighty" wait(2.5) Message:Destroy() end)
For after a player joined:
game:GetService("Players").PlayerAdded:connect(function(Player) local Message = Instance.new("Message",workspace) Message.Text = "Greetings O' Mighty "..Player.Name wait(2.5) Message:Destroy() end)
Do :Destroy() and :remove() method does the same thing or does something different? I'm not an up-to-date robloxian. |
|
|
| Report Abuse |
|
|
|
| 18 Nov 2012 11:40 PM |
function onTouched(h) game.Players[h.Parent.Name] end script.Parent.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|
|
| 19 Nov 2012 01:54 AM |
debounce = false
script.Parent.Touched:connect(function(h) if debounce == false then debounce = true local h = game.Players:GetPlayerFromCharacter(h.Parent) m = Instance.new("Message") m.Parent = p.PlayerGui m.Text = "Greetings" wait(3) m:Destroy() debounce = false end end)
Something like that should do, I added debounce so it doesn't spam. |
|
|
| Report Abuse |
|
|
Eddy3D
|
  |
| Joined: 21 Nov 2010 |
| Total Posts: 3017 |
|
|
| 19 Nov 2012 05:36 PM |
Wow interesting and woops I forgot the () after Destroy and mispelled function...
(~'3D'~) |
|
|
| Report Abuse |
|
|