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: Chat Script Help

Previous Thread :: Next Thread 
LegoGuyExtreme is not online. LegoGuyExtreme
Joined: 10 Sep 2008
Total Posts: 1267
14 Oct 2011 02:23 PM
Alright, so I made a script that goes INSIDE of the actual player (not the character, the Player) and makes it look like lightning strikes them(I'll cut this part short in the actual script)by making a part go to their torso when they chat. They can say anything, and the script will execute, but it won't work for some reason. I have to test this in Play mode, so I can't see what the output says. However, in solo mode, I can put the script in the player and no output errors occur. I would greatly appreciate it if someone would help. Thanks.

Script:


wait(0.1)

function onChatted()
player = script.Parent
guy = player.Character
p = Instance.new("Part")
p.Size = Vector3.new(5,200,5)
p.Anchored = true
p.CanCollide = false
p.BrickColor = BrickColor.new("Cyan")
p.Parent = game.Workspace
p.CFrame = CFrame.new(guy.Torso.CFrame.p)
guy.Humanoid.Health = 0
snd = script.Sound:Clone()
snd.Parent = guy.Torso
snd:Play()
p.Reflectance = 1
--This is where all the effects and stuff were.
p:Remove()
script:Remove()
end

script.Parent.Chatted:connect(onChatted)
Report Abuse
SCARFACIAL is not online. SCARFACIAL
Joined: 28 Jan 2010
Total Posts: 7970
14 Oct 2011 02:24 PM
Start Server > Start Player
game.Players.Player:SetSuperSafeChat(false)

Regards,
~Scarfacial
Report Abuse
LegoGuyExtreme is not online. LegoGuyExtreme
Joined: 10 Sep 2008
Total Posts: 1267
14 Oct 2011 02:30 PM
@Scar

I just tried that, but I put that script into the server and executed it when I started the player, but the output said this:

Unknown exception
Script "Workspace.Script", Line 1
stack end
Report Abuse
LegoGuyExtreme is not online. LegoGuyExtreme
Joined: 10 Sep 2008
Total Posts: 1267
14 Oct 2011 03:32 PM
Bump =/
Report Abuse
LegoGuyExtreme is not online. LegoGuyExtreme
Joined: 10 Sep 2008
Total Posts: 1267
14 Oct 2011 03:55 PM
Help?
Report Abuse
bikerking200 is not online. bikerking200
Joined: 11 Mar 2010
Total Posts: 5047
14 Oct 2011 04:22 PM
LOL Script.Parent.Chatted: --XD!
Report Abuse
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
14 Oct 2011 04:54 PM
Use the command bar when using that method


-Like an __AWESOME__ boss
Report Abuse
LegoGuyExtreme is not online. LegoGuyExtreme
Joined: 10 Sep 2008
Total Posts: 1267
14 Oct 2011 05:32 PM
Alright, so I used the command bar, and it worked, but when I chat, nothing happens and the output doesn't say anything. I think I may have written the connection wrong. (Maybe it's not called "Chatted")

@Biker

Back off. I've never done chat scripts before, and if you know the mistake I made, rather than making fun of me, you could have helped me, you dang ODing shaggy noob.
Report Abuse
Cachinnation is not online. Cachinnation
Joined: 21 Aug 2011
Total Posts: 1797
14 Oct 2011 05:33 PM
Why not just do this:

game.Players.PlayerAdded:connect(function(player)
player.Chatted:connect(function(m)
--stuff
end)
end)

goes in workspace
Report Abuse
LegoGuyExtreme is not online. LegoGuyExtreme
Joined: 10 Sep 2008
Total Posts: 1267
14 Oct 2011 05:36 PM
@Cach

It's because it's meant to work for only certain players, like someone will choose the person to be affected.
Report Abuse
Cachinnation is not online. Cachinnation
Joined: 21 Aug 2011
Total Posts: 1797
14 Oct 2011 05:38 PM
Then:

game.Players.PlayerAdded:connect(function(p)
if p.Name == "name" or "othername" or "otherothername" then
p.Chatted:connect(function(m)
--stuff
end)
end
end)
Report Abuse
LegoGuyExtreme is not online. LegoGuyExtreme
Joined: 10 Sep 2008
Total Posts: 1267
14 Oct 2011 05:42 PM
Thanks for your help so far, but that's still not what I want, so I'll explain it in greater detail.

I have something called the Book of Laws. With it, I can assign certain laws on other players that prevent them from doing something. One of the laws makes players unable to speak or they will die if they speak. When I assign the law to a certain player, the script is put into the player, and the player will die when they speak.
Report Abuse
Cachinnation is not online. Cachinnation
Joined: 21 Aug 2011
Total Posts: 1797
14 Oct 2011 05:50 PM
admin = {"LegoGuyExtreme"}
law = --workspace.BookOfLaws?

game.Players.PlayerAdded:connect(function(p)
if p.Name:lower() == unpack(admin):lower() then
p.Chatted:connect(function(m)
if m:sub(1,4) == "law/" then
law:clone().Parent = game.Players[m:sub(5)]
end
end)
end
end)
Report Abuse
Cachinnation is not online. Cachinnation
Joined: 21 Aug 2011
Total Posts: 1797
14 Oct 2011 05:51 PM
Oh, and if you wanted to do that thing in your first post, you should probably weld the part to the player's torso.
Report Abuse
palk47 is not online. palk47
Joined: 07 May 2009
Total Posts: 508
14 Oct 2011 06:28 PM
This might work;


function onChatted()
player = script.Parent
guy = player.Character
p = Instance.new("Part")
p.Size = Vector3.new(5,200,5)
p.Anchored = true
p.CanCollide = false
p.Color = Color.new("Cyan") --Typing Color is faster then BrickColor :P
p.Parent = game.Workspace
p.Position = CFrame.new(guy.Torso.Position.p)
guy.Humanoid.Health = 0
snd = script.Sound:Clone()
snd.Parent = guy.Torso
snd:Play()
p.Reflectance = 1

wait(0.3) -- FORGOT TO ADD THIS
--This is where all the effects and stuff were.
p:Remove()
script:Remove() -- Don't need this, but whatever...
end
Report Abuse
LegoGuyExtreme is not online. LegoGuyExtreme
Joined: 10 Sep 2008
Total Posts: 1267
14 Oct 2011 09:41 PM
@cach

Actually, the book of laws is a tool. The user holds it, there is a GUI interface from there where you can choose the law, and then choose the player to assign the law to. Then the script gets put into the player and it works from there.

@Palk

Thanks, but I already had a wait(2), but I didn't include that.
Report Abuse
LegoGuyExtreme is not online. LegoGuyExtreme
Joined: 10 Sep 2008
Total Posts: 1267
15 Oct 2011 09:18 AM
Bump
Report Abuse
LegoGuyExtreme is not online. LegoGuyExtreme
Joined: 10 Sep 2008
Total Posts: 1267
15 Oct 2011 09:19 AM
Oh yeah, and palk, I put the script:Remove() in there because I wanted it to work only once. Otherwise, if the player died, and chatted again, they would die.
Report Abuse
myrco919 is not online. myrco919
Joined: 12 Jun 2009
Total Posts: 13241
15 Oct 2011 09:22 AM
[ Content Deleted ]
Report Abuse
LegoGuyExtreme is not online. LegoGuyExtreme
Joined: 10 Sep 2008
Total Posts: 1267
15 Oct 2011 09:48 AM
@mycro

I just tried it in a LocalScript, and it still didn't work.
Report Abuse
LegoGuyExtreme is not online. LegoGuyExtreme
Joined: 10 Sep 2008
Total Posts: 1267
15 Oct 2011 10:40 AM
Bump
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