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: Custom chat

Previous Thread :: Next Thread 
Seeumliam is not online. Seeumliam
Joined: 06 May 2013
Total Posts: 5662
17 Dec 2014 01:55 PM
So with my custom chat I have it so that only people within 100 studs can hear you. Does this look right? Would this find players within 100 studs and allow them to hear you?

--This is the enter button on the chat (This will be the enter key in the future but it is a textbutton right now)




function onclick()

if script.Parent.Parent.TextBox.Text ~= "" and script.Parent.Parent.TextBox.Text ~= "Click and type to talk" and script.Parent.Parent.TextBox.Text ~= " "then
script.Parent.Parent.Parent.Chat.one.Value = script.Parent.Parent.Parent.Chat.two.Value
script.Parent.Parent.Parent.Chat.two.Value = script.Parent.Parent.Parent.Chat.three.Value
script.Parent.Parent.Parent.Chat.three.Value = script.Parent.Parent.Parent.Chat.four.Value
script.Parent.Parent.Parent.Chat.four.Value = script.Parent.Parent.Parent.Chat.five.Value
script.Parent.Parent.Parent.Chat.five.Value = script.Parent.Parent.Parent.Chat.six.Value
script.Parent.Parent.Parent.Chat.six.Value = game.Players.LocalPlayer.Name..": "..script.Parent.Parent.TextBox.Text
script.Parent.Parent.TextBox.Text = "Click and type to talk"
local plrs = game.Players:GetChildren()
local torso = game.Players.LocalPlayer.Character.Torso
for i,plr in ipairs(plrs) do
if plr.Character:findFirstChild("Humanoid") and plr.Character.Humanoid.Health > 0 then
local tor = plr.Character.Torso
if (torso.Position - tor.Position).magnitude < 100 then
plr.PlayerGui.Chat.one.Value = plr.PlayerGui.Chat.two.Value
plr.PlayerGui.Chat.two.Value = plr.PlayerGui.Chat.three.Value
plr.PlayerGui.Chat.three.Value = plr.PlayerGui.Chat.four.Value
plr.PlayerGui.Chat.four.Value = plr.PlayerGui.Chat.five.Value
plr.PlayerGui.Chat.five.Value = plr.PlayerGui.Chat.six.Value
plr.PlayerGui.Chat.six.Value = game.Players.LocalPlayer.Name..": "..script.Parent.Parent.TextBox.Text
end
end
end
end
end
script.Parent.MouseButton1Click:connect(onclick)





~ Seeumliam ~
Report Abuse
Seeumliam is not online. Seeumliam
Joined: 06 May 2013
Total Posts: 5662
17 Dec 2014 02:13 PM
I just tested it with two people and it doesn't work... I get no errors.. can someone help?


~ Seeumliam ~
Report Abuse
Seeumliam is not online. Seeumliam
Joined: 06 May 2013
Total Posts: 5662
17 Dec 2014 02:22 PM
So I fixed some problems... but one thing is, is when a player gets in range of me and I talk... I can't talk again and they can't hear me... Can you help? I think it is where it finds a player not with your name.

function onclick()

if script.Parent.Parent.TextBox.Text ~= "" and script.Parent.Parent.TextBox.Text ~= "Click and type to talk" and script.Parent.Parent.TextBox.Text ~= " "then
script.Parent.Parent.Parent.Chat.one.Value = script.Parent.Parent.Parent.Chat.two.Value
script.Parent.Parent.Parent.Chat.two.Value = script.Parent.Parent.Parent.Chat.three.Value
script.Parent.Parent.Parent.Chat.three.Value = script.Parent.Parent.Parent.Chat.four.Value
script.Parent.Parent.Parent.Chat.four.Value = script.Parent.Parent.Parent.Chat.five.Value
script.Parent.Parent.Parent.Chat.five.Value = script.Parent.Parent.Parent.Chat.six.Value
script.Parent.Parent.Parent.Chat.six.Value = game.Players.LocalPlayer.Name..": "..script.Parent.Parent.TextBox.Text
script.Parent.Parent.TextBox.Text = "Click and type to talk"
local plrs = game.Players:GetChildren()
local torso = game.Players.LocalPlayer.Character.Torso
for i,plr in ipairs(plrs) do
if plr.Character:findFirstChild("Humanoid") and plr.Character.Humanoid.Health > 0 then
local tor = plr.Character.Torso
if (torso.Position - tor.Position).magnitude < 100 then
if plr.Name ~= game.Players.LocalPlayer.Name then
plr.PlayerGui.Chat.Chat.one.Value = plr.PlayerGui.Chat.Chat.two.Value
plr.PlayerGui.Chat.Chat.two.Value = plr.PlayerGui.Chat.Chat.three.Value
plr.PlayerGui.Chat.Chat.three.Value = plr.PlayerGui.Chat.Chat.four.Value
plr.PlayerGui.Chat.Chat.four.Value = plr.PlayerGui.Chat.Chat.five.Value
plr.PlayerGui.Chat.Chat.five.Value = plr.PlayerGui.Chat.Chat.six.Value
plr.PlayerGui.Chat.Chat.six.Value = game.Players.LocalPlayer.Name..": "..script.Parent.Parent.TextBox.Text
script.Parent.Parent.TextBox.Text = "Click and type to talk"
end
end
end
end
end
end
script.Parent.MouseButton1Click:connect(onclick)


~ Seeumliam ~
Report Abuse
Seeumliam is not online. Seeumliam
Joined: 06 May 2013
Total Posts: 5662
17 Dec 2014 03:17 PM
So I got rid of most of it and made it so it would tell yourself what you said what is wrong?



function onclick()

if script.Parent.Parent.TextBox.Text ~= "" and script.Parent.Parent.TextBox.Text ~= "Click and type to talk" and script.Parent.Parent.TextBox.Text ~= " "then

local plrs = game.Players:GetChildren()
local torso = game.Players.LocalPlayer.Character.Torso
for i,plr in ipairs(plrs) do
if plr.Character:findFirstChild("Humanoid") and plr.Character.Humanoid.Health > 0 then
local tor = plr.Character.Torso
if (torso.Position - tor.Position).magnitude < 100 then
plr.PlayerGui.Chat.one.Value = plr.PlayerGui.Chat.two.Value
plr.PlayerGui.Chat.two.Value = plr.PlayerGui.Chat.three.Value
plr.PlayerGui.Chat.three.Value = plr.PlayerGui.Chat.four.Value
plr.PlayerGui.Chat.four.Value = plr.PlayerGui.Chat.five.Value
plr.PlayerGui.Chat.five.Value = plr.PlayerGui.Chat.six.Value
plr.PlayerGui.Chat.six.Value = game.Players.LocalPlayer.Name..": "..script.Parent.Parent.TextBox.Text
script.Parent.Parent.TextBox.Text = "Click and type to talk"
end
end
end
end
end
script.Parent.MouseButton1Click:connect(onclick)



~ Seeumliam ~
Report Abuse
Seeumliam is not online. Seeumliam
Joined: 06 May 2013
Total Posts: 5662
17 Dec 2014 04:29 PM
Bump


~ Seeumliam ~
Report Abuse
maxomega3 is not online. maxomega3
Joined: 11 Jun 2010
Total Posts: 10668
17 Dec 2014 04:53 PM
What's wrong with setting the chat bubble range to 100
Report Abuse
D4rKP01s0n is not online. D4rKP01s0n
Joined: 29 Sep 2011
Total Posts: 316
17 Dec 2014 04:54 PM
Because people can still see it in the gui, I guess.

But all you have to do is disable the gui and set he chat bubble range to 100

Deal with it
Report Abuse
Seeumliam is not online. Seeumliam
Joined: 06 May 2013
Total Posts: 5662
17 Dec 2014 05:30 PM
I don't want to use the bubble because it is hard to read if you are behind a wall.... mine makes it like you are talking normal chat, but it is only in proximity



~ Seeumliam ~
Report Abuse
Seeumliam is not online. Seeumliam
Joined: 06 May 2013
Total Posts: 5662
17 Dec 2014 06:25 PM
Bump


~ Seeumliam ~
Report Abuse
Seeumliam is not online. Seeumliam
Joined: 06 May 2013
Total Posts: 5662
17 Dec 2014 06:49 PM
I think it is something in here:

local plrs = game.Players:GetChildren()
local torso = game.Players.LocalPlayer.Character.Torso
for i,plr in ipairs(plrs) do
if plr.Character:findFirstChild("Humanoid") and plr.Character.Humanoid.Health > 0 then
local tor = plr.Character.Torso
if (torso.Position - tor.Position).magnitude < 100 then



I can talk to myself, but when I chat to another player it doesn't show anything. And then when I go to talk again when close to another player it won't let me type


~ Seeumliam ~
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