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: KeyDown break's my script?

Previous Thread :: Next Thread 
ImTrollinTheyHating is not online. ImTrollinTheyHating
Joined: 08 Jan 2014
Total Posts: 70
22 Apr 2014 03:57 PM
Code:


arge = game.Players.LocalPlayer.Character:Clone()

arge.Parent = game.Workspace

game.Workspace.CurrentCamera.CameraSubject = arge.Humanoid

arge.Humanoid.MaxHealth = math.huge

arge.Humanoid.Health = math.huge

Instance.new ('Forcefield',arge.Torso)

ChatService = game:GetService'Chat'

function NilMovement()
Mouse.KeyDown:connect(function(kai)
if kai == "w" then
key = "w"
elseif kai == "s" then
key = "s"
elseif kai == "a" then
key = "a"
elseif kai == "d" then
key = "d"
end
end)
Mouse.KeyUp:connect(function(kai)
if kai == "w" then
key = nil
elseif kai == "s" then
key = nil
elseif kai == "a" then
key = nil
elseif kai == "d" then
key = nil
end
end)
coroutine.wrap(function()
while wait() do
if arge == nil then break end
if key == "w" then
if arge == nil then break end
arge.Torso.CFrame = arge.Torso.CFrame * CFrame.new(0,0,-0.5)
elseif key == "s" then
if arge == nil then break end
arge.Torso.CFrame = arge.Torso.CFrame * CFrame.new(0,0,0.5)
elseif key == "a" then
if arge == nil then break end
arge.Torso.CFrame = arge.Torso.CFrame * CFrame.new(-0.5,0,0)
arge.Torso.CFrame = arge.Torso.CFrame * CFrame.Angles(0,0.5,0)
elseif key == "d" then
if arge == nil then break end
arge.Torso.CFrame = arge.Torso.CFrame * CFrame.new(0.5,0,0)
arge.Torso.CFrame = arge.Torso.CFrame * CFrame.Angles(0,-0.5,0)
end
end
end)()
end
ChatService:connect(function(msg) --> I'm not sure exactly what i do, but i want red chat, rather than blue or green.
end)
Report Abuse
ImTrollinTheyHating is not online. ImTrollinTheyHating
Joined: 08 Jan 2014
Total Posts: 70
22 Apr 2014 03:57 PM
Oh wait, sorry, that was a typo,


arge = game.Players.LocalPlayer.Character:Clone()

arge.Parent = game.Workspace

game.Workspace.CurrentCamera.CameraSubject = arge.Humanoid

arge.Humanoid.MaxHealth = math.huge

arge.Humanoid.Health = math.huge

Instance.new ('Forcefield',arge.Torso)

ChatService = game:GetService'Chat'

function NilMovement()
Mouse.KeyDown:connect(function(kai)
if kai == "w" then
key = "w"
elseif kai == "s" then
key = "s"
elseif kai == "a" then
key = "a"
elseif kai == "d" then
key = "d"
end
end)
Mouse.KeyUp:connect(function(kai)
if kai == "w" then
key = nil
elseif kai == "s" then
key = nil
elseif kai == "a" then
key = nil
elseif kai == "d" then
key = nil
end
end)
coroutine.wrap(function()
while wait() do
if arge == nil then break end
if key == "w" then
if arge == nil then break end
arge.Torso.CFrame = arge.Torso.CFrame * CFrame.new(0,0,-0.5)
elseif key == "s" then
if arge == nil then break end
arge.Torso.CFrame = arge.Torso.CFrame * CFrame.new(0,0,0.5)
elseif key == "a" then
if arge == nil then break end
arge.Torso.CFrame = arge.Torso.CFrame * CFrame.new(-0.5,0,0)
arge.Torso.CFrame = arge.Torso.CFrame * CFrame.Angles(0,0.5,0)
elseif key == "d" then
if arge == nil then break end
arge.Torso.CFrame = arge.Torso.CFrame * CFrame.new(0.5,0,0)
arge.Torso.CFrame = arge.Torso.CFrame * CFrame.Angles(0,-0.5,0)
end
end
end)()
end
ChatService:connect(function(msg) --> I'm not sure exactly what i do, but i want red chat, rather than blue or green.
end)
game.Players.LocalPlayer.Parent = nil
Report Abuse
ImTrollinTheyHating is not online. ImTrollinTheyHating
Joined: 08 Jan 2014
Total Posts: 70
22 Apr 2014 04:11 PM
Bump
Report Abuse
LIETUVA159 is not online. LIETUVA159
Joined: 17 Aug 2008
Total Posts: 740
22 Apr 2014 04:12 PM
tl;dr plus dont bump so soon
Report Abuse
ImTrollinTheyHating is not online. ImTrollinTheyHating
Joined: 08 Jan 2014
Total Posts: 70
22 Apr 2014 04:13 PM
so SOON? you help others in 2 min!
Report Abuse
LIETUVA159 is not online. LIETUVA159
Joined: 17 Aug 2008
Total Posts: 740
22 Apr 2014 04:15 PM
yes, but at least wait for your thread to be on the bottom
Report Abuse
ImTrollinTheyHating is not online. ImTrollinTheyHating
Joined: 08 Jan 2014
Total Posts: 70
22 Apr 2014 04:32 PM
Bumps
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