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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: weld not working

Previous Thread :: Next Thread 
Rocketgamer10 is not online. Rocketgamer10
Joined: 21 Jan 2009
Total Posts: 4347
08 Aug 2012 11:46 AM
script.Parent.MouseButton1Click:connect(function()
if ison then
ison=false
p:Destroy()
script.Parent.Text="Anti-Grief: OFF"
else
ison=true
c=script.Parent.Parent.Parent.Parent.Character
p=Instance.new("Part",c)
w=Instance.new("Weld",p)
script.Parent.Text="Anti-Grief: ON"
p.Size=Vector3.new(8,8,8)
p.CFrame = c.Torso.CFrame
w.Part0 = p
w.Part1 = c.Torso
p.Shape=0
p.BrickColor=BrickColor.new("Bright blue")
p.Transparency = 0.6
p.TopSurface = "Smooth"
p.BottomSurface = "Smooth"
p.Anchored=false
p.CanCollide=false
end
end)

**It is supposed to create a forcefield that welds to a player's torso, but the weld for some reason doesn't work**
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
08 Aug 2012 11:47 AM
I'm guessing this isn't the whole script?

† KMXD †
Report Abuse
Rocketgamer10 is not online. Rocketgamer10
Joined: 21 Jan 2009
Total Posts: 4347
08 Aug 2012 11:47 AM
You guessed wrong...
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
08 Aug 2012 11:50 AM
You defined p after using it:

p:Destroy() --using p
script.Parent.Text="Anti-Grief: OFF"
else
ison=true
c=script.Parent.Parent.Parent.Parent.Character
p=Instance.new("Part",c) --defining it
Report Abuse
Rocketgamer10 is not online. Rocketgamer10
Joined: 21 Jan 2009
Total Posts: 4347
08 Aug 2012 11:51 AM
That's not the problem, I did that once before and it worked.
Report Abuse
Rocketgamer10 is not online. Rocketgamer10
Joined: 21 Jan 2009
Total Posts: 4347
08 Aug 2012 11:53 AM
YOU NOOBS UR NOT HELPING ME I REPORTED ALL OF YOU!@!!!!!!!!!!!!!!!!!
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
08 Aug 2012 11:55 AM
If this is the whole script, ison is never defined, so it would never fire.

† KMXD †
Report Abuse
Rocketgamer10 is not online. Rocketgamer10
Joined: 21 Jan 2009
Total Posts: 4347
08 Aug 2012 11:56 AM
ison is just a value in the script, not an object
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