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
 

[ Content Deleted ]

Previous Thread :: Next Thread 
Nicolas77 is not online. Nicolas77
Joined: 29 Jul 2008
Total Posts: 3158
10 Jan 2012 12:02 PM
[ Content Deleted ]
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
10 Jan 2012 12:05 PM
Not really possible to do, really. You can try using raycasting, though.

­<'+1 Post. Ujelly?'>
Report Abuse
Nicolas77 is not online. Nicolas77
Joined: 29 Jul 2008
Total Posts: 3158
10 Jan 2012 12:06 PM
[ Content Deleted ]
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
10 Jan 2012 12:10 PM
Eh, efficiently, you can use raycasting. Inefficiently you can have bricks around the pin, and when the pin touches it, the pin is removed.

­<'+1 Post. Ujelly?'>
Report Abuse
grimm343 is not online. grimm343
Joined: 18 Sep 2008
Total Posts: 2796
10 Jan 2012 12:11 PM
Add a small, slightly thicker (though not as tall) brick on the top, and when it touches a brick named xx (The brick under the pins), they are :destroy()'ed?
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
10 Jan 2012 12:13 PM
Even with grimms idea, it'd still be inefficient in a manner. There's no real efficient way to do this, raycasting would cause lag, but would be more efficient in the sense that it would work better than the other ideas.

­<'+1 Post. Ujelly?'>
Report Abuse
Nicolas77 is not online. Nicolas77
Joined: 29 Jul 2008
Total Posts: 3158
10 Jan 2012 12:13 PM
[ Content Deleted ]
Report Abuse
YaYaBinks3 is not online. YaYaBinks3
Joined: 05 Jun 2009
Total Posts: 2631
10 Jan 2012 12:25 PM
You don't need raycasting.
Just test how long it takes for the pin to fall, then add wait(etc.) into it.

~ HAIL COBRAS! ~
Report Abuse
grimm343 is not online. grimm343
Joined: 18 Sep 2008
Total Posts: 2796
10 Jan 2012 12:31 PM
Nicolas, it would trigger when the invisible brick on the top of the pin touched the brick under the pins, which would only occur when it fell over.
Report Abuse
rossb654mail is not online. rossb654mail
Joined: 12 Oct 2009
Total Posts: 11004
10 Jan 2012 12:32 PM
I go with Yaya's post
Though this is SH, not C&G, so don't put clan siggy's in :D
Report Abuse
Fl0x is not online. Fl0x
Joined: 06 Aug 2010
Total Posts: 5169
10 Jan 2012 12:34 PM
You could check with the .Changed event if the floored position changed (not minimal changes) and make them dissapear, then.
Report Abuse
su8 is not online. su8
Joined: 06 Mar 2009
Total Posts: 6334
10 Jan 2012 12:54 PM
@nate
You can also use FindPartsInRegion3 :P
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
10 Jan 2012 02:38 PM
"You could check with the .Changed event if the floored position changed"

.Changed doesn't fire for Vector3s or CFrames.

Raycasting would be the ideal thing to use.

­<'+1 Post. Ujelly?'>
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
10 Jan 2012 02:39 PM
"You don't need raycasting.
Just test how long it takes for the pin to fall, then add wait(etc.) into it."

How do you know if the pin is falling? Bah.

­<'+1 Post. Ujelly?'>
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
10 Jan 2012 02:48 PM
local a=0
while wait(.1) do
    for i=1,4 do
    --[[ local p=Instance.new("Part",workspace)
        p.Anchored=true
        p.BrickColor=BrickColor.new(1,0,0)
        p.Transparency=.5
        p.Size=Vector3.new(10,1,1)
        p.CFrame=script.Parent.CFrame*CFrame.Angles(0,i,0)]]
        local cf=script.Parent.CFrame*CFrame.Angles(0,i,0)
        local ray=Ray.new(script.Parent.Position,cf.lookVector*1)
        local hit=workspace:FindPartOnRay(ray)
        if hit and hit.Name=="Ground" then
            print("Fell"..a)
            a=a+1
        end
    end
end

­<'+1 Post. Ujelly?'>
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
10 Jan 2012 02:48 PM
local a=0
while wait(.1) do
for i=1,4 do
--[[ local p=Instance.new("Part",workspace)
p.Anchored=true
p.BrickColor=BrickColor.new(1,0,0)
p.Transparency=.5
p.Size=Vector3.new(10,1,1)
p.CFrame=script.Parent.CFrame*CFrame.Angles(0,i,0)]]
local cf=script.Parent.CFrame*CFrame.Angles(0,i,0)
local ray=Ray.new(script.Parent.Position,cf.lookVector*1)
local hit=workspace:FindPartOnRay(ray)
if hit and hit.Name=="Ground" then
print("Fell"..a)
a=a+1
end
end
end
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
10 Jan 2012 02:51 PM
Left the comment so you can see how it works.

­<'+1 Post. Ujelly?'>
Report Abuse
Nicolas77 is not online. Nicolas77
Joined: 29 Jul 2008
Total Posts: 3158
10 Jan 2012 02:52 PM
[ Content Deleted ]
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
10 Jan 2012 03:04 PM
Putting that in a script in the pin should work.

Basically it constantly casts rays around the perimeter of the object, looking if there is anything within 1 stud of it, if there is, and it's named 'Ground' then it will register as it was hit.

Name the ground around the pins 'Ground'

    local fell=false

    while wait() and not fell do
        for i=1,4 do
        --[[ local p=Instance.new("Part",workspace)
            p.Anchored=true
            p.BrickColor=BrickColor.new(1,0,0)
            p.Transparency=.5
            p.Size=Vector3.new(10,1,1)
            p.CFrame=script.Parent.CFrame*CFrame.Angles(0,i,0)]]
            local cf=script.Parent.CFrame*CFrame.Angles(0,i,0)
            local ray=Ray.new(script.Parent.Position,cf.lookVector*1)
            local hit=workspace:FindPartOnRay(ray)
            if hit and hit.Name=="Ground" then
            --    print("Fell over")
                script.Parent:Destroy()
                fell=true
                break;
            end
        end
    end


­<'+1 Post. Ujelly?'>
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
10 Jan 2012 03:09 PM
"while wait() and not fell do"

Was testing it to see if it would work, you can add a larger wait time, 1 second would do. Depends on how quickly you want it to be able to register if it had fallen.

­<'+1 Post. Ujelly?'>
Report Abuse
Nicolas77 is not online. Nicolas77
Joined: 29 Jul 2008
Total Posts: 3158
10 Jan 2012 03:10 PM
[ Content Deleted ]
Report Abuse
Nicolas77 is not online. Nicolas77
Joined: 29 Jul 2008
Total Posts: 3158
10 Jan 2012 03:13 PM
[ Content Deleted ]
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
10 Jan 2012 03:13 PM
No problem. Wasn't actually going to write it for you, but just wanted to prove that it can easily be done with raycasting.

­<'+1 Post. Ujelly?'>
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
10 Jan 2012 03:14 PM
    local fell=false

    while wait() and not fell do
        for i=1,4 do
        --[[ local p=Instance.new("Part",workspace)
            p.Anchored=true
            p.BrickColor=BrickColor.new(1,0,0)
            p.Transparency=.5
            p.Size=Vector3.new(10,1,1)
            p.CFrame=script.Parent.CFrame*CFrame.Angles(0,i,0)]]
            local cf=script.Parent.CFrame*CFrame.Angles(0,i,0)
            local ray=Ray.new(script.Parent.Position,cf.lookVector*1)
            local hit=workspace:FindPartOnRay(ray)
            if hit and hit.Name=="Ground" then
            --    print("Fell over")
            --    script.Parent:Destroy()
                script.Parent.Transparency=1
                fell=true
                break;
            end
        end
    end

­<'+1 Post. Ujelly?'>
Report Abuse
Nicolas77 is not online. Nicolas77
Joined: 29 Jul 2008
Total Posts: 3158
10 Jan 2012 03:15 PM
[ Content Deleted ]
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