Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

can someone fix this script plz?

Asked by 10 years ago

function a(key) if key = "e" then x = Instance.new("Part") x.CFrame = script.Parent.Parent.Character.Torso.CFrameCFrame.new(0,0,5) y = Instance.new("BodyVelocity", x) y.maxForce = Vector3.new(math.huge,math.huge,math.huge) y.velocity = script.Parent.Parent.Character.CFrame.lookVector80 x.Touched:connect(function(target) if target.Parent:FindFirstChild("Humanoid") then target.Parent.Humanoid.Health = target.Parent.Humanoid.Health - 20 if target.Parent.Humanoid.Health == 0 then script.Parent.leaderstats.xp = script.Parent.leaderstats.xp + 5 script.Parent.leaderstats.gold = script.Parent.leaderstats.gold +5 end end end) game.Debris:AddItem(x,5) end end

mouse.KeyDown:connect(a)

Im not very sure why it doesnt work, i need someone to tell me

0
If you put your script in a code block, then we will help you.... kudorey619 138 — 10y

2 answers

Log in to vote
0
Answered by 10 years ago

It is quite hard to view a script without putting

code here

Please do that and then we will help you!

Best regards, Nathan.

Ad
Log in to vote
0
Answered by 10 years ago
function a(Key)

if key = "e" then

x = Instance.new("Part")

x.CFrame = script.Parent.Parent.Character.Torso.CFrame*CFrame.new(0,0,5)

y = Instance.new("BodyVelocity", x)

y.maxForce = Vector3.new(math.huge,math.huge,math.huge)

y.velocity = script.Parent.Parent.Character.CFrame.lookVector*80

end

game.Debris:AddItem(x,5)

end

end

mouse.KeyDown:connect(a) ~~~~~~~~~~~~~~~~~

Answer this question