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 » Scripters
Home Search
 

Re: My Script Is Not Working

Previous Thread :: Next Thread 
DJumble is online. DJumble
Joined: 28 Dec 2015
Total Posts: 440
30 Dec 2015 06:53 PM
So I am making a script where the player presses down a key and something comes out, but the script is not working.
This is the script:

Player = game.Players.LocalPlayer
Char = Player.Character
Torso = Char.Torso
Mouse = Player:GetMouse()

function EarhKick(key)
key = key:lower()
if key == "v"then
print("v key was pressed")
for i = 1, 100, 3 do
EarthBlock = Instance.new("Part")
EarthBlock.Parent = Workspace
EarthBlock.Size = Vector3.new(math.random(4,6),math.random(4,6),math.random(4,6))
EarthBlock.Anchored = true
EarthBlock.TopSurface = 0
EarthBlock.BottomSurface = 0
EarthBlock.BrickColor = BrickColor.new("Brown")
EarthBlock.CFrame = CFrame.new(Torso.Position.x,4,Torso.Position.z) * CFrame.new(0,0,-1) * CFrame.Angles(math.random(),math.random(),math.random())
wait()
end
end
end
end
Mouse.KeyDown:connect(EarthKick)
Report Abuse
toflyc is not online. toflyc
Joined: 08 Jul 2011
Total Posts: 985
30 Dec 2015 07:49 PM
Did you put it in a LocalScript?
Report Abuse
MrJoeyJoeJoey is not online. MrJoeyJoeJoey
Joined: 20 Aug 2011
Total Posts: 20787
30 Dec 2015 08:00 PM
Dont repost you swine

1. Local your variables
2. Make proper case of ur vairables
3. For this spesifc case use an anonymous event


local player = game.Players.LocalPlayer
local character = player.Character
local torso = character.Torso
local mouse = player:GetMouse()

mouse.KeyDown:connect(function(key)
if key == "v" then
print("v key was pressed")
for i = 1, 100, 3 do
local EarthBlock = Instance.new("Part")
EarthBlock.Parent = workspace
EarthBlock.Size = Vector3.new(math.random(4,6),math.random(4,6),math.random(4,6))
EarthBlock.Anchored = true
EarthBlock.TopSurface = 0
EarthBlock.BottomSurface = 0
EarthBlock.BrickColor = BrickColor.new("Brown")
EarthBlock.CFrame = torso.CFrame * CFrame.new(0,-2.5,-1) * CFrame.Angles(math.random(),math.random(),math.random())
wait()
end
end
end)
Report Abuse
BFFstick00 is not online. BFFstick00
Joined: 25 Oct 2010
Total Posts: 800
30 Dec 2015 08:01 PM
Seriously a repost? Your last thread was fine.

http://www.roblox.com/my/sets.aspx?id=1519004
Report Abuse
MrJoeyJoeJoey is not online. MrJoeyJoeJoey
Joined: 20 Aug 2011
Total Posts: 20787
30 Dec 2015 08:03 PM
EarthBlock.CFrame = CFrame.new(torso.Position.X,3,torso.Position.Z) + Vector3.new(math.random(-5,5),0,math.random(-5,5))
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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