Advertisement
Guest User

Code for my Charlie Charlie game

a guest
May 29th, 2015
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.80 KB | None | 0 0
  1. _G.ChatDebounce = true
  2. local chatdb = _G.ChatDebounce
  3. local WordTable = {
  4.     "Charlie is getting bored...",
  5.     "Waiting for a question to be asked...",
  6.     "Ask Charlie something, you may get the answer you desire...",
  7.     "Ask a question, step right up!",
  8.     "Ask your old pal Charlie anything!",
  9.     "Ask a spoopy question, get a spoopy answer.",
  10.     "Its so spooky, I know. Now ask a question",
  11.     "Charlie is getting restless..."
  12.     }
  13.  
  14. game.Players.PlayerAdded:connect(function(plr)
  15.     plr.CharacterAdded:connect(function(char)
  16.         wait(1)
  17.         local scr = game.ServerScriptService.CamScript:Clone()
  18.         scr.Parent = plr.PlayerGui
  19.         scr.Disabled = false
  20.         char:Destroy()
  21.     end)
  22.     plr.Chatted:connect(function(msg)
  23.         if chatdb == true and string.match(msg, "Charlie Charlie") then
  24.             chatdb = false
  25.             game.Workspace.ChosenChat:Play()
  26.             game.Workspace.MessageInput.SurfaceGui.Frame.TextLabel.Text = plr.Name.." Asked: "..msg
  27.             wait(3)
  28.             game.Workspace.MessageInput.SurfaceGui.Frame.TextLabel.Text = "Charlie is thinking..."
  29.             local numberz = math.random(10,360)
  30.             wait(math.random(3,7))
  31.             game.Workspace.MessageInput.SurfaceGui.Frame.TextLabel.Text = "Charlie is answering..."
  32.             local sum = 0
  33.             for x = 1,math.abs(numberz) do
  34.                 game.Workspace.SpinnyPencil.SpinnyPart.CFrame = CFrame.new(game.Workspace.SpinnyPencil.SpinnyPart.Position) * CFrame.Angles(math.rad(game.Workspace.SpinnyPencil.SpinnyPart.Rotation.X),math.rad(game.Workspace.SpinnyPencil.SpinnyPart.Rotation.Y), math.rad(game.Workspace.SpinnyPencil.SpinnyPart.Rotation.Z + 1))
  35.                 wait()
  36.             end
  37.             game.Workspace.MessageInput.SurfaceGui.Frame.TextLabel.Text = "Charlie has answered."
  38.             wait(2)
  39.             local phrase = WordTable[math.random(1,#WordTable)]
  40.             game.Workspace.MessageInput.SurfaceGui.Frame.TextLabel.Text = phrase
  41.             chatdb = true
  42.         end
  43.     end)
  44. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement