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 » Scripting Helpers
Home Search
 

Re: HELP !!!

Previous Thread :: Next Thread 
sylwek1100 is not online. sylwek1100
Joined: 07 Nov 2010
Total Posts: 42
28 Oct 2013 07:20 AM
function fire(d)
s=script.Parent.Handle.Fire
s:play()
bullet=Instance.new("Part")
bullet.FormFactor="Custom"
bullet.Size=Vector3.new(0.4,0.2,0.2)
bullet.BrickColor=BrickColor.new("Really black")
bullet.Position=tool.Part.Position+(d*5)
bullet.Velocity=d*100
script.Parent.GripUp=Vector3.new(0.01,1,-0.3)
script.Parent.Part.Transparency=0.7
wait(.1)
script.Parent.Part.Transparency=1
script.Parent.GripUp=Vector3.new(0.01,1,0)
bullet.Touched:connect(function(hit)
bullet:remove()
chr=hit.Parent
if game.Players:GetPlayerFromCharacter(chr) and chr:findFirstChild("Humanoid") then
plr=game.Players:GetPlayerFromCharacter(chr)
if chr.Humanoid.Health>0 then
chr.Humanoid:TakeDamage(math.random(10,20))
end
v=Workspace.g:GetChildren() -- this is where it goes wrong @@@@@@@@@
else if v:hit() then
game.Workspace.v.Transparency=1
game.Workspace.v.CanCollide=false
wait(1000)
game.Workspace.v.Transparency=0.5
game.Workspace.v.CanCollide=true
end
end
end)
force=Instance.new("BodyForce")
force.force=Vector3.new(0,3,0)
force.Parent=bullet
bullet.Parent=game.Workspace
end

Help me with the script, v=workspace.g:GetChildren() should get the children out of g which are g1 and g2 but if they are hit by the bullet one of them which got hit should disapear .
Report Abuse
sylwek1100 is not online. sylwek1100
Joined: 07 Nov 2010
Total Posts: 42
28 Oct 2013 10:35 AM
Refresh1
Report Abuse
sylwek1100 is not online. sylwek1100
Joined: 07 Nov 2010
Total Posts: 42
28 Oct 2013 11:07 AM
Refresh2
Report Abuse
sylwek1100 is not online. sylwek1100
Joined: 07 Nov 2010
Total Posts: 42
28 Oct 2013 11:37 AM
Refresh 3
Report Abuse
CustardCream95 is not online. CustardCream95
Joined: 16 Aug 2012
Total Posts: 579
28 Oct 2013 11:40 AM
Line 3: You cannot play a fire. Didn't read it all though.
Report Abuse
UgOsMiLy is not online. UgOsMiLy
Joined: 15 Sep 2009
Total Posts: 2095
28 Oct 2013 11:42 AM
Line 3: Its Fire.Enabled = true
Report Abuse
UgOsMiLy is not online. UgOsMiLy
Joined: 15 Sep 2009
Total Posts: 2095
28 Oct 2013 11:44 AM
I think you forgot to tell the script what you mean by "G" but if you have something in the workspace actually called g then ignore me.
Report Abuse
sylwek1100 is not online. sylwek1100
Joined: 07 Nov 2010
Total Posts: 42
28 Oct 2013 11:45 AM
Yeah i fixed that but the problem i with g1 touching with the bullet making it disapear which does not work
Report Abuse
sylwek1100 is not online. sylwek1100
Joined: 07 Nov 2010
Total Posts: 42
28 Oct 2013 11:46 AM
v=Workspace.g:GetChildren()
game.Workspace.v.Transparency=1
game.Workspace.v.CanCollide=false
wait(1000)
game.Workspace.v.Transparency=0.5
game.Workspace.v.CanCollide=true
Report Abuse
sylwek1100 is not online. sylwek1100
Joined: 07 Nov 2010
Total Posts: 42
28 Oct 2013 11:47 AM
"g" is a group inside it there is g1 , g2.
Report Abuse
UgOsMiLy is not online. UgOsMiLy
Joined: 15 Sep 2009
Total Posts: 2095
28 Oct 2013 11:55 AM
Sorry, but i am not an expert scripter, I can only do stuff like local and while true do and if and function.
Report Abuse
sylwek1100 is not online. sylwek1100
Joined: 07 Nov 2010
Total Posts: 42
28 Oct 2013 11:57 AM
Custard ow the Fire thing is a sound when the guns fires ^^
Report Abuse
sylwek1100 is not online. sylwek1100
Joined: 07 Nov 2010
Total Posts: 42
28 Oct 2013 12:05 PM
Someone help ?
Report Abuse
nukeysaurusrex is not online. nukeysaurusrex
Joined: 24 Oct 2013
Total Posts: 2451
28 Oct 2013 12:11 PM
(Fire is a sound guys, you were correct to use :Play)

Your issue is that 'v' only means one child of "g". Try reading through "generic for" on the Wiki. This is an example of one:

for _,v in pairs(g:GetChildren()) do --This gets ALL the children of "g". The variable for all of these is "v".
v.Transparency=1 --Will set "v" (all children of "g") to 1 transparency.
end
Report Abuse
sylwek1100 is not online. sylwek1100
Joined: 07 Nov 2010
Total Posts: 42
28 Oct 2013 12:15 PM
Yes i know that but my problem is when child of g is touched by bullet it should disapear so i take all of the children out of g and the one which gets touched by bullet should disapear but it doesnt and i dont know how to fix that ;/
Report Abuse
nukeysaurusrex is not online. nukeysaurusrex
Joined: 24 Oct 2013
Total Posts: 2451
28 Oct 2013 12:17 PM
v=g:GetChildren()

The term v is only applicable to ONE child of g.

You would either to do it manually (v[1],v[2],etc) or do what I said. There is another method but is haxxy and uses too much CPU by checking every child.
Report Abuse
sylwek1100 is not online. sylwek1100
Joined: 07 Nov 2010
Total Posts: 42
28 Oct 2013 12:22 PM
Ok it works but it makes all of the g's disapear and it should make the glass which got touched by a bullet.
Report Abuse
sylwek1100 is not online. sylwek1100
Joined: 07 Nov 2010
Total Posts: 42
28 Oct 2013 01:10 PM
Refresh1
Report Abuse
sylwek1100 is not online. sylwek1100
Joined: 07 Nov 2010
Total Posts: 42
28 Oct 2013 01:51 PM
Refresh2
Report Abuse
sylwek1100 is not online. sylwek1100
Joined: 07 Nov 2010
Total Posts: 42
28 Oct 2013 02:10 PM
Refresh3
Report Abuse
sylwek1100 is not online. sylwek1100
Joined: 07 Nov 2010
Total Posts: 42
28 Oct 2013 02:59 PM
Refresh4
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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