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: what is wrong with these scripts?

Previous Thread :: Next Thread 
CoolGoku485 is not online. CoolGoku485
Joined: 20 May 2012
Total Posts: 52
10 Aug 2012 03:14 PM
i made them 2 years ago and forgot some stuff i put in there please help

here is the first:
r = game:service("RunService")


arrow = script.Parent
Owner = arrow.Owner
damage = 3
position = arrow.Position

function fly()
direction = arrow.CFrame.lookVector
position = position + (direction*6)
error = position - arrow.Position
arrow.Velocity = error * 50
end

function onTouched(hit)

if hit.Parent.Name ~= Owner.Value.Name then
humanoid = hit.Parent:findFirstChild("Humanoid")
if humanoid~=nil then
humanoid.Health = humanoid.Health - damage
end
explosion = game.Lighting.Bewm:clone()
explosion.Position = arrow.Position
explosion.Parent = workspace
wait()
arrow:Remove()
end
end

arrow.Touched:connect(onTouched)

t, s = r.Stepped:wait()

d = t + 7.0 - s

while t < d do
fly()
t = r.Stepped:wait()
end

arrow:Remove()


here is the second:
bin = script.Parent
Backpack = bin.Parent
Me = Backpack.Parent
PlayerGui = Me.PlayerGui
Ki = PlayerGui.Bars.Ki
Data = Me.Data

Activated = Me.Character.Occupied

local COOLDOWN = 0.5




r = game:service("RunService")


MAX_VELOCITY = 180
MIN_VELOCITY = 20

PULLBACK_TIME = 0

wait(0.1)


local Arrow = Instance.new("Part")
Arrow.Locked = true
Arrow.BackSurface = 0
Arrow.BottomSurface = 0
Arrow.FrontSurface = 0
Arrow.LeftSurface = 0
Arrow.RightSurface = 0
Arrow.Name = "Blast"
Arrow.TopSurface = 0
Arrow.formFactor = "Symmetric"
Arrow.Shape = "Ball"
Arrow.Size = Vector3.new(2,2,2)
if Data.Ki.Value == 1 then
Arrow.BrickColor = BrickColor.new(23)
elseif Data.Ki.Value == 2 then
Arrow.BrickColor = BrickColor.new(21)
elseif Data.Ki.Value == 3 then
Arrow.BrickColor = BrickColor.new(1023)
elseif Data.Ki.Value == 4 then
Arrow.BrickColor = BrickColor.new(106)
elseif Data.Ki.Value == 5 then
Arrow.BrickColor = BrickColor.new(37)
elseif Data.Ki.Value == 6 then
Arrow.BrickColor = BrickColor.new(26)
elseif Data.Ki.Value == 7 then
Arrow.BrickColor = BrickColor.new(1)
end
Arrow.Transparency = 0.25
Arrow.Reflectance = 0.075
Owner = Instance.new("ObjectValue")
Owner.Parent = Arrow
Owner.Name = "Owner"
Owner.Value = Me
script.Parent.ArrowScript:clone().Parent = Arrow

local force = Instance.new("BodyForce")
force.force = Vector3.new(0,313,0)
force.Parent = Arrow

function fire(target)
if Ki.Value >= 50 and Activated.Value == false then

local head = game.Players.LocalPlayer.Character:findFirstChild("Head")
if head == nil then return end

local dir = target - head.Position
dir = computeDirection(dir)

print("DIR X:", dir.x, "Y:", dir.y, "z:", dir.z)

local missile = Arrow:clone()

local spawnPos = game.Players.LocalPlayer.Character.PrimaryPart.Position

local pos = spawnPos + (dir * 5)

missile.CFrame = CFrame.new(pos, pos + dir)

missile.ArrowScript.Disabled = false

local creator_tag = Instance.new("ObjectValue")
creator_tag.Value = game.Players.LocalPlayer
creator_tag.Name = "creator"
creator_tag.Parent = missile

missile.Parent = game.Workspace
Chance = math.random(1, 3)
if Chance == 1 then
Data.KiControl.KiXP.Value = Data.KiControl.KiXP.Value+50
else
Data.KiControl.KiXP.Value = Data.KiControl.KiXP.Value+15
end
Ki.Value = Ki.Value - 50
end
end

function computeDirection(vec)
local lenSquared = vec.magnitude * vec.magnitude
local invSqrt = 1 / math.sqrt(lenSquared)
return Vector3.new(vec.x * invSqrt, vec.y * invSqrt, vec.z * invSqrt)
end

enabled = true
function onButton1Down(mouse)
if not enabled then
return
end

local player = game.Players.LocalPlayer
if player == nil then return end

enabled = false
mouse.Icon = "http://www.roblox.com/asset/?id=41672909"


local pos = mouse.Hit.p


fire(pos, MAX_VELOCITY)


wait(COOLDOWN)
mouse.Icon = "http://www.roblox.com/asset/?id=11624732"
enabled = true

end

function onSelected(mouse)
mouse.Icon = "http://www.roblox.com/asset/?id=11624732"
mouse.Button1Down:connect(function() onButton1Down(mouse) end)
end

script.Parent.Selected:connect(onSelected)
Report Abuse
su8 is not online. su8
Joined: 06 Mar 2009
Total Posts: 6334
10 Aug 2012 03:14 PM
stop spamming noob
Report Abuse
SolarCrane is not online. SolarCrane
Forum Moderator
Joined: 03 Jul 2012
Total Posts: 116
10 Aug 2012 04:22 PM
It would help if you could post what error you are getting from the output window.
Report Abuse
CoolGoku485 is not online. CoolGoku485
Joined: 20 May 2012
Total Posts: 52
11 Aug 2012 08:35 AM
ok it says for the first one Me is not a valid something or other (i dont really remember
Report Abuse
CoolGoku485 is not online. CoolGoku485
Joined: 20 May 2012
Total Posts: 52
11 Aug 2012 08:36 AM
sorry i mean the second one says me is not a valid something dont remeber
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