Ttdp
|
  |
| Joined: 03 Jul 2014 |
| Total Posts: 155 |
|
|
| 21 Jul 2017 06:29 PM |
My script works but the vector position won't work, I did a print value check and the X and Z numbers are always 0!!! Why is this?
Meteor_Size = Vector3.new(50,25,55) Meteor_Shape = "Ball"
function MakeBaseMeteor()
local Meteor = Instance.new("Part",game.Workspace) Meteor.Name = "Meteor" Meteor.Size = Meteor_Size Meteor.BrickColor = BrickColor.new("Dark Blue") Meteor.Transparency = 0.5 Meteor.Anchored = false Meteor.CanCollide = true Meteor.Shape = Meteor_Shape
return Meteor
end
NGC = game.Workspace.NPC NGC_Head = NGC.Head.Position
function OnClick() local MeteorBase = MakeBaseMeteor() local MeteorClone = MeteorBase local Meteor_Blast = MeteorClone:clone() local Random = math.random(1,4) print (Random) if Random == 1 then Meteor_Blast.Position = (NGC_Head + Vector3.new(11,5,8)) print (MeteorClone.Position) wait (2) game.Debris:AddItem(MeteorClone,0.2) end if Random == 2 then Meteor_Blast.Position = (NGC_Head + Vector3.new(9,5,11)) print (MeteorClone.Position) wait (2) game.Debris:AddItem(MeteorClone,0.2) end if Random == 3 then Meteor_Blast.Position = (NGC_Head + Vector3.new(22,5,3)) print (MeteorClone.Position) wait (2) game.Debris:AddItem(MeteorClone,0.2) end if Random == 4 then Meteor_Blast.Position = (NGC_Head + Vector3.new(10,8,6)) print (MeteorClone.Position) wait (2) game.Debris:AddItem(MeteorClone,0.2) end end
Brick = game.Workspace.Trigger
-- Click Event --
Brick.Touched:connect(OnClick) |
|
|
| Report Abuse |
|
|
Ttdp
|
  |
| Joined: 03 Jul 2014 |
| Total Posts: 155 |
|
|
| 21 Jul 2017 06:34 PM |
| ok so no1 replies but other incoming late questions get replies... |
|
|
| Report Abuse |
|
|
|
| 21 Jul 2017 06:36 PM |
try this format vector3.new(1, 1, 1) use the spaces
oof |
|
|
| Report Abuse |
|
|
|
| 21 Jul 2017 06:36 PM |
You never set the position. Apparently the default position for it is 0.
|
|
|
| Report Abuse |
|
|
|
| 21 Jul 2017 06:37 PM |
"try this format" Doesn't make a difference, but I'm sure he appreciates the help c:
|
|
|
| Report Abuse |
|
|
|
| 21 Jul 2017 06:38 PM |
oh ok i always used that so it though it might help
oof |
|
|
| Report Abuse |
|
|
Ttdp
|
  |
| Joined: 03 Jul 2014 |
| Total Posts: 155 |
|
|
| 21 Jul 2017 06:39 PM |
| It's a function activated event. It's not supposed to have a pre-set position, it's almost the equivalent of a rocket launcher automatically being launched from the tool. It always spawns in the center of the head |
|
|
| Report Abuse |
|
|
|
| 21 Jul 2017 06:40 PM |
I understand, but Meteor_Blast and MeteorClone are two separate things.
Meteor_Blast.Position = (NGC_Head + Vector3.new(11,5,8)) print (MeteorClone.Position)
|
|
|
| Report Abuse |
|
|
Ttdp
|
  |
| Joined: 03 Jul 2014 |
| Total Posts: 155 |
|
|
| 21 Jul 2017 06:43 PM |
| Aren't they the same value.. I only used MeteorClone because game:getservice only reads it as that |
|
|
| Report Abuse |
|
|
Ttdp
|
  |
| Joined: 03 Jul 2014 |
| Total Posts: 155 |
|
| |
|
|
| 21 Jul 2017 06:51 PM |
To clarify: local MeteorBase = MakeBaseMeteor() local MeteorClone = MeteorBase local Meteor_Blast = MeteorClone:clone()
MeteorClone and MeteorBase reference the same instance.
Meteor_Blast and MeteorClone (and by extension MeteorBase) are not the same instance, since Meteor_Blast is a copy. |
|
|
| Report Abuse |
|
|