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
|
  |
| Joined: 08 Jul 2011 |
| Total Posts: 985 |
|
|
| 30 Dec 2015 07:49 PM |
| Did you put it in a LocalScript? |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|