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: This script blows my mind as to why it works wrongly.

Previous Thread :: Next Thread 
shadostriker is not online. shadostriker
Joined: 07 Aug 2008
Total Posts: 7860
23 Sep 2012 10:11 AM
This script is part of a bigger script, and even when I hit an anchored part it gives me a point. When it prints it says it is not anchored but when I check the item it hits it is...

e.Hit:connect(function(hit)
if not hit.Parent:FindFirstChild("Humanoid") and not hit.Parent.Parent:FindFirstChild("Humanoid") and hit.Anchored == false then --Problem line

print(hit.Anchored, hit.Name)--Problem line

char = game.Players:findFirstChild(Tool.Parent.Name)

if char and hit.TopSurface ~= 0 then
char.leaderstats.Points.Value = char.leaderstats.Points.Value +1
end

hit:BreakJoints()
hit.BackSurface = 0
hit.BottomSurface = 0
hit.FrontSurface = 0
hit.LeftSurface = 0
hit.RightSurface = 0
hit.TopSurface = 0

hit.Velocity = ((hit.Position - e.Position).unit * 100) + Vector3.new(0,-100,0)
debris:AddItem(hit, 4)
elseif hit.Parent:FindFirstChild("Humanoid") and(hit.Position - Tool.Parent.Torso.Position).magnitude < 7 then
hit.Parent.Torso.Velocity = ((hit.Parent.Torso.Position - e.Position).unit * Vector3.new(250,0,250)) + Vector3.new(0,Tool.jump.Value,0)
end
end)
Report Abuse
shadostriker is not online. shadostriker
Joined: 07 Aug 2008
Total Posts: 7860
23 Sep 2012 10:17 AM
Help D:
Report Abuse
Darkmist101 is not online. Darkmist101
Joined: 30 Jul 2010
Total Posts: 6208
23 Sep 2012 10:52 AM
e.Hit:connect(function(hit)???

Touched
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
23 Sep 2012 10:57 AM
e might be an explosion...

http://www.roblox.com/CeaselessSouls-Admin-Commands-Gui-based-item?id=92856199 -- Take one and enjoy! Read the description, has a lot of information.
Report Abuse
shadostriker is not online. shadostriker
Joined: 07 Aug 2008
Total Posts: 7860
23 Sep 2012 10:59 AM
e is an explosion.
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
23 Sep 2012 11:00 AM
I just pwned Dark...

http://www.roblox.com/CeaselessSouls-Admin-Commands-Gui-based-item?id=92856199 -- Take one and enjoy! Read the description, has a lot of information.
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
23 Sep 2012 11:00 AM
Although, I never seen you define the explosion(e = Instance.new("Explosion",game.Workspace)).

http://www.roblox.com/CeaselessSouls-Admin-Commands-Gui-based-item?id=92856199 -- Take one and enjoy! Read the description, has a lot of information.
Report Abuse
shadostriker is not online. shadostriker
Joined: 07 Aug 2008
Total Posts: 7860
23 Sep 2012 11:04 AM
Btw it is not an error.
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
23 Sep 2012 11:09 AM
Oh, :3.

http://www.roblox.com/CeaselessSouls-Admin-Commands-Gui-based-item?id=92856199 -- Take one and enjoy! Read the description, has a lot of information.
Report Abuse
shadostriker is not online. shadostriker
Joined: 07 Aug 2008
Total Posts: 7860
23 Sep 2012 11:44 AM
Help D:
Report Abuse
breuning is not online. breuning
Joined: 30 Oct 2008
Total Posts: 4268
23 Sep 2012 11:45 AM
Output please.
Report Abuse
mamaguy is not online. mamaguy
Joined: 07 Oct 2010
Total Posts: 7073
23 Sep 2012 11:53 AM
@Breu
He said it was not an error,
Learn to pay attention ;)
Report Abuse
shadostriker is not online. shadostriker
Joined: 07 Aug 2008
Total Posts: 7860
23 Sep 2012 11:57 AM
@Mama: Ty :)
Report Abuse
mamaguy is not online. mamaguy
Joined: 07 Oct 2010
Total Posts: 7073
23 Sep 2012 12:02 PM
if not (hit.Parent:FindFirstChild("Humanoid")) and not ( hit.Parent.Parent:FindFirstChild("Humanoid")) and not (hit.Anchored) then
?
Report Abuse
shadostriker is not online. shadostriker
Joined: 07 Aug 2008
Total Posts: 7860
23 Sep 2012 12:04 PM
Nope. Still gave me a point.
Report Abuse
shadostriker is not online. shadostriker
Joined: 07 Aug 2008
Total Posts: 7860
23 Sep 2012 12:42 PM
:'c
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
23 Sep 2012 12:46 PM
e.Touched:connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") ~= nil and hit.Parent.Parent:FindFirstChild("Humanoid") ~= nil and hit.Anchored == false then --Problem line

print(hit.Anchored, hit.Name)--I don't think you can print hit.Anchored, that'll return nil

char = game.Players:findFirstChild(Tool.Parent.Name)

if char and hit.TopSurface ~= 0 then
char.leaderstats.Points.Value = char.leaderstats.Points.Value +1
end

hit:BreakJoints()
hit.BackSurface = 0
hit.BottomSurface = 0
hit.FrontSurface = 0
hit.LeftSurface = 0
hit.RightSurface = 0
hit.TopSurface = 0

hit.Velocity = ((hit.Position - e.Position).unit * 100) + Vector3.new(0,-100,0)
debris:AddItem(hit, 4)
elseif hit.Parent:FindFirstChild("Humanoid") and(hit.Position - Tool.Parent.Torso.Position).magnitude < 7 then
hit.Parent.Torso.Velocity = ((hit.Parent.Torso.Position - e.Position).unit * Vector3.new(250,0,250)) + Vector3.new(0,Tool.jump.Value,0)
end
end)
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
23 Sep 2012 12:47 PM
I'm being stupid:

e.Touched:connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") ~= nil and hit.Parent.Parent:FindFirstChild("Humanoid") ~= nil and hit.Anchored == false then --Problem line

print(hit.Anchored .. hit.Name)--I don't think you can print hit.Anchored, that'll return nil

char = game.Players:findFirstChild(Tool.Parent.Name)

if char and hit.TopSurface ~= 0 then
char.leaderstats.Points.Value = char.leaderstats.Points.Value +1
end

hit:BreakJoints()
hit.BackSurface = 0
hit.BottomSurface = 0
hit.FrontSurface = 0
hit.LeftSurface = 0
hit.RightSurface = 0
hit.TopSurface = 0

hit.Velocity = ((hit.Position - e.Position).unit * 100) + Vector3.new(0,-100,0)
debris:AddItem(hit, 4)
elseif hit.Parent:FindFirstChild("Humanoid") and(hit.Position - Tool.Parent.Torso.Position).magnitude < 7 then
hit.Parent.Torso.Velocity = ((hit.Parent.Torso.Position - e.Position).unit * Vector3.new(250,0,250)) + Vector3.new(0,Tool.jump.Value,0)
end
end)
Report Abuse
shadostriker is not online. shadostriker
Joined: 07 Aug 2008
Total Posts: 7860
23 Sep 2012 02:22 PM
When you print a bool it prints true or false.
Report Abuse
shadostriker is not online. shadostriker
Joined: 07 Aug 2008
Total Posts: 7860
23 Sep 2012 02:34 PM
No one knows..?
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
23 Sep 2012 03:01 PM
Yes it does.

http://www.roblox.com/CeaselessSouls-Admin-Commands-Gui-based-item?id=92856199 -- Take one and enjoy! Read the description, has a lot of information.
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