|
| 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 |
|
|
|
| 14 Oct 2011 02:24 PM |
Start Server > Start Player game.Players.Player:SetSuperSafeChat(false)
Regards, ~Scarfacial |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
| |
|
| |
|
|
| 14 Oct 2011 04:22 PM |
| LOL Script.Parent.Chatted: --XD! |
|
|
| Report Abuse |
|
|
|
| 14 Oct 2011 04:54 PM |
Use the command bar when using that method
-Like an __AWESOME__ boss |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
| |
|
|
| 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
|
  |
| Joined: 12 Jun 2009 |
| Total Posts: 13241 |
|
| |
|
|
| 15 Oct 2011 09:48 AM |
@mycro
I just tried it in a LocalScript, and it still didn't work. |
|
|
| Report Abuse |
|
|
| |
|