|
I honestly do not know whats wrong, i am getting no output and the only time it does not work is when i press a diffrent button other than R. Please hel
--------------------------------------------------
local enabled = true
Name = script.Parent.Parent.Name
Player = script.Parent.Parent.Parent
mouse = Player:GetMouse()
run = game:GetService("RunService")
print(Player)
function onKeyDown(key)
if not enabled then return end
enabled = false
Key = key:lower()
if key == "R" then
if Player.InUse.Value == false and Player.Magic.Value >=10 then
Player.Magic.Value = Player.Magic.Value - 10
Player:FindFirstChild("InUse").Value = true
enabled = false
if Player.SideValue.Value/8 == Player.Magic.Value then
Player.Character:remove()
end
Player.SideValue.Value = Player.Magic.Value
wait(0.5)
c = Instance.new("Part")
c.BrickColor = BrickColor.new("Really red")
Decal1 = Instance.new("Decal",c)
Decal1.Texture = "http://www.roblox.com/asset/?id=121028264"
Decal1.Face = "Back"
Decal2 = Instance.new("Decal",c)
Decal2.Texture = "http://www.roblox.com/asset/?id=121028264"
Decal2.Face = "Front"
c.Size = Vector3.new(0,0,0)
c.TopSurface = "Smooth"
c.BottomSurface = "Smooth"
c.Shape = "Block"
c.Name = "MagicBrick"
c.CanCollide = false
c.Transparency = 1
c.Anchored = true
c.Parent = Player.Character
game.Debris:AddItem(c,3)
c.CFrame = Player.Character.Head.CFrame*CFrame.new(0, 0, -1.8)
local Anime = Instance.new("Animation")
Anime.AnimationId = "http://www.roblox.com/Asset?ID=163799047"
local animTrack = Player.Character.Humanoid:LoadAnimation(Anime)
animTrack:Play()
for i = 1,6 do
c.Size = Vector3.new(i,i,0)
wait(0.1)
end
wait(0.5)
game:GetService("Chat"):Chat(Player.Character.Head, "Test")
z = Instance.new("Part")
z.BrickColor = BrickColor.new("Really red")
z.Size = Vector3.new(0,0,0)
z.TopSurface = "Smooth"
z.BottomSurface = "Smooth"
z.Shape = "Ball"
z.Name = "MagicBrick"
z.CanCollide = false
z.Transparency = 1
z.Anchored = true
z.Parent = Player.Character
game.Debris:AddItem(z,4)
z.CFrame = Player.Character.Head.CFrame*CFrame.new(0, 0, -1.2)
for i = 1,40 do
x = Instance.new("Part")
x.BrickColor = BrickColor.new("Really red")
x.Size = Vector3.new(i,i,i)
x.TopSurface = "Smooth"
x.BottomSurface = "Smooth"
x.Shape = "Ball"
x.Name = "MagicBrick"
x.CanCollide = false
x.Transparency = 0.7
x.Anchored = true
x.Parent = Player.Character
script.Damage:clone().Parent = x
game.Debris:AddItem(x,2)
x.CFrame = z.CFrame*CFrame.new(0, 0, -1.2-i)
wait(0.01)
end
--Player.InUse.Value = false
Player:FindFirstChild("InUse").Value = false
enabled = true
end
end
end
mouse.KeyDown:connect(onKeyDown)
-------------------------------------------------- |
|
|
|
>if key == "R" then
>mouse.KeyDown:connect(onKeyDown)
Clicking does not do the function.
It allows you to look if r is pressed.
I hate the LGBT. Those laser guided battle tanks are just too damn powerful. |
|
|
wtf are you talking about clicking? there is no clicking in this script its all keydown. |
|
fajner1Join Date: 2008-03-30 Post Count: 77 |
> the only time it does not work is when i press a diffrent button other than R
Is this not intended? Line 11 is /* if key == "R" then */, which would be why it only works when you press R. |
|
|
That is not what i ment. if i click r it works. if i click, for a example q. then press r again. r wont work any more |
|
|
|
|