|
| 08 Jul 2011 04:07 PM |
I'm bored and I have nothing to do. I'll answer scripting questions to the best of my knowledge, and fix your scripts as long as they are not outrageous.
Go. |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2011 04:08 PM |
function onFire(gun) local Hit, Pos = game.Workspace:FindPartOnRay(Ray.new(gun.Position, gun.CFrame.lookVector * 999)) local b = Instance.new("Part") b.Parent = game.Workspace b.Position = gun.Position:Lerp(Pos, 0.1) b.formFactor = 0 b.Size = Vector3.new(1,.4,1) b.BrickColor = BrickColor.new(194) b.Name = "Rocket" local bv = Instance.new("BodyVelocity") bv.velocity = gun.CFrame.lookVector * 1000 bv.Parent = b local s = script.Parent.Rocket:Clone() s.Disabled = false s.Parent = b local M = script.Parent.Rockett:Clone() M.Parent = b local K = Instance.new("Smoke") K.Parent = b K.RiseVelocity = 10 local creator_tag = Instance.new("ObjectValue") creator_tag.Value = script.Parent.Parent.Parent creator_tag.Name = "creator" creator_tag.Parent = b end
The missile that is shot comes back from the place where it was shot from. (This is a plane missile shoot script) The plane is in the position where the missile was shot from before and is attacked by its own missile. Any way to fix it?
|
|
|
| Report Abuse |
|
|
|
| 08 Jul 2011 04:09 PM |
"The missile that is shot comes back from the place where it was shot from. (This is a plane missile shoot script) The plane is in the position where the missile was shot from before and is attacked by its own missile. Any way to fix it?"
I can't understand the problem. Could you rephrase it please? |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2011 04:11 PM |
Ok here. FIrst off, this is a plane misile shoot script. The missile is shot from let's say a position of 50,12,15. The missile comes backs to that position. By that time, the plane has reached that point, and the missile shoots its maker. |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2011 04:13 PM |
@citymaster22
So you're saying the plane runs into it's own bullet? I'm sorry, I am just really confused here. |
|
|
| Report Abuse |
|
|
| |
|
|
| 08 Jul 2011 04:14 PM |
| could you view my thread? its the mine thread |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2011 04:15 PM |
print("Nights MineScript")
toolneeded = { "Pickaxe" } Rock = script.Parent
function mineScript(name) for i = 1,#toolneeded do
if (string.upper(name) == string.upper(toolneeded[i])) then return true end end return false end
function onTouched(hit) print("Rock Hit") local human = hit.Parent:findFirstChild("Humanoid") if (human ~= nil ) then game.Lighting.MagicOre:clone().Parent = player.Backpack end end
end
connection = Rock.Touched:connect(onTouched)
When the pickaxe touches the rock it gives the player a Ore Thats all if you need more info just tell me |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2011 04:17 PM |
@citymaster22
Ok if I am understanding right, the plane is moving too fast so it runs into it's own bullet, or something like that. Increasing the distance from the plane when the bullet is spawned, as well as increasing the missile speed should work. Try this out.
function onFire(gun) local Hit, Pos = game.Workspace:FindPartOnRay(Ray.new(gun.Position, gun.CFrame.lookVector * 999)) local b = Instance.new("Part") b.Parent = game.Workspace b.Position = gun.Position:Lerp(Pos, 0.25) b.formFactor = 0 b.Size = Vector3.new(1,.4,1) b.BrickColor = BrickColor.new(194) b.Name = "Rocket" local bv = Instance.new("BodyVelocity") bv.velocity = gun.Velocity + gun.CFrame.lookVector * 100 bv.Parent = b local s = script.Parent.Rocket:Clone() s.Disabled = false s.Parent = b local M = script.Parent.Rockett:Clone() M.Parent = b local K = Instance.new("Smoke") K.Parent = b K.RiseVelocity = 10 local creator_tag = Instance.new("ObjectValue") creator_tag.Value = script.Parent.Parent.Parent creator_tag.Name = "creator" creator_tag.Parent = b end
|
|
|
| Report Abuse |
|
|
|
| 08 Jul 2011 04:18 PM |
"When the pickaxe touches the rock it gives the player a Ore Thats all if you need more info just tell me"
Is that what it does, or what it is supposed to do? Is there any information in the output? |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2011 04:19 PM |
@DR No, the CFrame glitch causes the missile to be teleported back where it was shot from. |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2011 04:20 PM |
| thats what its suppsoed to do sorry. |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2011 04:20 PM |
@city
CFrame glitch? What have I missed? |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2011 04:21 PM |
| A lot. It causes the object CFramed to be CFramed back to the position it was CFrame from. |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2011 04:23 PM |
@night
Well the problem is, you're doing this:
local human = hit.Parent:findFirstChild("Humanoid")
Which would check for a humanoid inside the tool, which doesn't exist. You need to check for the humanoid inside the character, which would be something like...
localhuman = hit.Parent.Parent:findFirstChild("Humanoid") |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2011 04:24 PM |
"A lot. It causes the object CFramed to be CFramed back to the position it was CFrame from."
Well I can't fix Roblox glitches. Sorry I couldn't help :| |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2011 04:24 PM |
| Lawl, but what about using the OffSet property of BlockMesh to simulate the movement? |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2011 04:26 PM |
@city
Simulate the movement? If you did that, how would you detect collisions with enemies? You couldn't blow stuff up really |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2011 04:27 PM |
| But once it had touched the enemy, it would move the brick to that position, and then boom |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2011 04:28 PM |
| But the BlockMesh doesn't have a .Touched event. It would be near impossible (but totally impractical anyways) to detect collisions with a mesh. |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2011 04:28 PM |
Nothing happens when I click, and the mouse icon doesn't change, BUT I only get output AFTER I click :-/
Output: Players.Player.Backpack.Bomb.Script:6: attempt to index local 'mouse' (a nil value)
local tool = script.Parent local plant = false local money = 7
tool.Activated:connect(function(mouse) mouse.Icon = "rbxasset://textures\\GunCursor.png" --Line 6 mouse.Button1Down:connect(function() if plant == true then return end plant = true mouse.Icon = "rbxasset://textures\\GunWaitCursor.png" bomb = Instance.new("Part",workspace) bomb.Name = "Bomb" bomb.Reflectance = 1 bomb.Shape = "Ball" bomb.Size = Vector3.new(2,2,2) bomb.Position = tool.Parent.Head.Position wait(3) exp = Instance.new("Explosion",bomb) exp.Name = "Bewm :3" exp.BlastRadius = 20 exp.BlastPressure = 1000000 exp.Position = exp.Parent.Position exp.Hit:connect(function(part) ghosts = 0 if part.Parent.Name == "Ghost" then ghosts = ghosts + 1 part.Parent:BreakJoints() player = game.Players:GetPlayerFromCharacter(tool.Parent) stats = player:findFirstChild("leaderstats") cash = stats:findFirstChild("Cash") if cash then cash.Value = cash.Value + money*ghosts bomb:remove() end end end) wait(3) plant = false mouse.Icon = "rbxasset://textures\\GunCursor.png" end) end)
|
|
|
| Report Abuse |
|
|
|
| 08 Jul 2011 04:29 PM |
| So how the heck does crazyman32 do it? |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2011 04:30 PM |
@2above
tool.Equipped:connect(function(mouse) |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2011 04:32 PM |
@pomp
Is that in a tool or hopperbin, and a script or localscript?
@city
He doesn't use mainstream free-model planes. :D |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2011 04:33 PM |
@Dr I'm using his starterkit. And he told me that's the way he did it. He used RayCast to detect what it hit, used OffSet to simulate the movement of the missile and then blew it up using the actual missile by moving it :P |
|
|
| Report Abuse |
|
|