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: Can't figure this out

Previous Thread :: Next Thread 
trail39rulez is not online. trail39rulez
Joined: 12 Dec 2010
Total Posts: 50027
04 Jun 2014 06:32 PM
Not a scripter, not my script, but I do understand it a bit

function onChatted(msg, recipient, speaker)

local source = string.lower(speaker.Name)
msg = string.lower(msg)
local pos1 = script.Parent.Position
local pos2 = speaker.Character.Head.Position
dist=(pos1-pos2).magnitude
dist=dist-math.max(math.max(speaker.Character.Head.Size.x, speaker.Character.Head.Size.z), speaker.Character.Head.Size.y)
if (dist <= 5 and script.Parent.On.Value == true) then
local m = Instance.new("Hint")
h.Parent = game.Workspace
h.Text = msg
wait(10)
h:remove()
end

end

function onPlayerEntered(newPlayer)
newPlayer.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, newPlayer) end)
end

game.Players.ChildAdded:connect(onPlayerEntered)
Report Abuse
diabete is not online. diabete
Joined: 07 May 2014
Total Posts: 230
04 Jun 2014 06:34 PM
You mean like what it does?

if 1 + 1 ~= 2 then print("The world is ending!") elseif 1 + 1 == "fish" then print("All is well")
Report Abuse
trail39rulez is not online. trail39rulez
Joined: 12 Dec 2010
Total Posts: 50027
04 Jun 2014 06:37 PM
I need the message to come out, I don't see any issues, it doesn't work, idk if roblox is to blame.
Report Abuse
diabete is not online. diabete
Joined: 07 May 2014
Total Posts: 230
04 Jun 2014 06:40 PM
local h = Instance.new("Hint", nil)
game.Players.PlayerAdded:connect(function(p)
repeat wait() until p.Character
p.Chatted:connect(function(msg)
h.Text = msg
wait(3)
h.Parent = nil
end)
end)
Report Abuse
diabete is not online. diabete
Joined: 07 May 2014
Total Posts: 230
04 Jun 2014 06:40 PM
^ Insert siggy

if 1 + 1 ~= 2 then print("The world is ending!") elseif 1 + 1 == "fish" then print("All is well")
Report Abuse
trail39rulez is not online. trail39rulez
Joined: 12 Dec 2010
Total Posts: 50027
04 Jun 2014 06:43 PM
I'llgive it a try, tat seems much better and less sloppy
Report Abuse
trail39rulez is not online. trail39rulez
Joined: 12 Dec 2010
Total Posts: 50027
04 Jun 2014 06:53 PM
Nothing for me
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