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 » Scripting Helpers
Home Search
 

Re: Script Help

Previous Thread :: Next Thread 
Eddy3D is not online. Eddy3D
Joined: 21 Nov 2010
Total Posts: 3017
21 Jan 2013 11:39 AM
function h(hit)
local g = game.Players.GetPlayerFromCharacter(h.Parent)
local m = Instance.new("Message")
m.Parent = g.PlayerGui
m.Text = "You touched me e_e..."
wait(3)
m:Remove()
end

script.Parent.onTouched:connect(h)

Whats the mistake?

I'm Superman ~(/'-')/
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
21 Jan 2013 11:40 AM
function h(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local g = game.Players.GetPlayerFromCharacter(hit.Parent)
local m = Instance.new("Message")
m.Parent = g.PlayerGui
m.Text = "You touched me e_e..."
wait(3)
m:Remove()
end
end

Report Abuse
crouton04 is not online. crouton04
Joined: 07 Jul 2010
Total Posts: 4459
21 Jan 2013 11:41 AM
g = game.Players:GetPlayerFromCharacter(hit.Parent.Name)


Was that your mom? Tell her she needs to exercise a little more, those legs had a little flab.
Report Abuse
Eddy3D is not online. Eddy3D
Joined: 21 Nov 2010
Total Posts: 3017
21 Jan 2013 11:56 AM
They both didn't work...

I'm Superman ~(/'-')/
Report Abuse
megaguy44 is not online. megaguy44
Joined: 28 Sep 2008
Total Posts: 1066
21 Jan 2013 12:03 PM
function h(hit)
local g = game.Players.GetPlayerFromCharacter(hit.Parent)
if (g) then
local m = Instance.new("Message")
m.Parent = g.PlayerGui
m.Text = "You touched me e_e..."
wait(3)
m:Remove()
end
end

script.Parent.Touched:connect(h) -- You had "onTouched"


print('Hello World!')
Report Abuse
Eddy3D is not online. Eddy3D
Joined: 21 Nov 2010
Total Posts: 3017
21 Jan 2013 12:06 PM
Hmm It still didn't work.
I insert the script inside the part but it's no working...

I'm Superman ~(/'-')/
Report Abuse
megaguy44 is not online. megaguy44
Joined: 28 Sep 2008
Total Posts: 1066
21 Jan 2013 12:08 PM
-- Allow me to try this again,
script.Parent.Touched:connect(function(Hit)
local Player = game:GetService("Players"):GetPlayerFromCharacter(Hit.Parent)
if (Player and Player:FindFirstChild("PlayerGui") and not Player:FindFirstChild("Use")) then
Instance.new("BoolValue", Player).Name = "Use"
local Message = Instance.new("Message", Player.PlayerGui)
Message.Text = "You touched me, qq"
wait(3)
if (Message) then Message:Destroy() end
if (Player:FindFirstChild("Use")) then Player.Use:Destroy() end
end
end)


print('Hello World!')
Report Abuse
Eddy3D is not online. Eddy3D
Joined: 21 Nov 2010
Total Posts: 3017
21 Jan 2013 12:10 PM
k That one worked thanks.

I'm Superman ~(/'-')/
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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