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: Mirror Script Help

Previous Thread :: Next Thread 
BruceAB12 is not online. BruceAB12
Joined: 19 Jan 2012
Total Posts: 3238
23 Oct 2013 07:19 PM
local length = 1000
local sp = script.Parent
local hit, pos = workspace:FindPartOnRay(Ray.new(script.Parent.Position,((script.Parent.Position+script.Parent.CFrame.lookVector)-script.Parent.Position).unit*length))
if hit ~= nil then
print(hit)
a = hit:Clone()
a.Parent = Game.Workspace
a.Anchored = true
a.Position = Vector3.new(hit.Position.X,hit.Position.Y,math.floor(sp.Position.Z-hit.Position.Z))
if a.Position.Z > sp.Position.Z then
a:Destroy()
end
end
if hit == nil then
print("No part to reflect found!")
end
if hit.Parent:IsA("Model") then
b = hit.Parent:FindFirstChild("Head")
b1 = hit.Parent:FindFirstChild("Torso")
b2 = hit.Parent:FindFirstChild("Left Arm")
b3 = hit.Parent:FindFirstChild("Right Arm")
b4 = hit.Parent:FindFirstChild("Left Leg")
b5 = hit.Parent:FindFirstChild("Right Leg")
b:Clone()
b1:Clone()
b2:Clone()
b3:Clone()
b4:Clone()
b5:Clone()
b.Anchored = true
b1.Anchored = true
b2.Anchored = true
b3.Anchored = true
b4.Anchored = true
b5.Anchored = true
b.Parent = Game.Workspace
b1.Parent = Game.Workspace
b2.Parent = Game.Workspace
b3.Parent = Game.Workspace
b4.Parent = Game.Workspace
b5.Parent = Game.Workspace
b.Position = Vector3.new(b.Position.X,b.Position.Y,math.floor(sp.Position.Z-b.Position.Z))
b1.Position = Vector3.new(b1.Position.X,b1.Position.Y,math.floor(sp.Position.Z-b1.Position.Z))
b2.Position = Vector3.new(b2.Position.X,b2.Position.Y,math.floor(sp.Position.Z-b2.Position.Z))
b3.Position = Vector3.new(b3.Position.X,b3.Position.Y,math.floor(sp.Position.Z-b3.Position.Z))
b4.Position = Vector3.new(b4.Position.X,b4.Position.Y,math.floor(sp.Position.Z-b4.Position.Z))
b5.Position = Vector3.new(b5.Position.X,b5.Position.Y,math.floor(sp.Position.Z-b5.Position.Z))
end

This sort of works however, when ever I get in front of the mirror part and set the script inside it to disabled to false it clones me but it kills me :/

What seems to be the problem?
Report Abuse
Lapwn is not online. Lapwn
Joined: 03 Jun 2012
Total Posts: 5975
23 Oct 2013 07:21 PM
I dont know mabey a:Destroy() on line 12 or something
Report Abuse
BruceAB12 is not online. BruceAB12
Joined: 19 Jan 2012
Total Posts: 3238
23 Oct 2013 07:23 PM
No it wasn't that :(
Report Abuse
BruceAB12 is not online. BruceAB12
Joined: 19 Jan 2012
Total Posts: 3238
23 Oct 2013 07:27 PM
bump
Report Abuse
BruceAB12 is not online. BruceAB12
Joined: 19 Jan 2012
Total Posts: 3238
23 Oct 2013 07:33 PM
bumpy
Report Abuse
rowerowe71 is not online. rowerowe71
Joined: 14 Apr 2013
Total Posts: 1999
23 Oct 2013 07:39 PM
Wait does this make a working mirror because if it does i want one!!!
Report Abuse
Lapwn is not online. Lapwn
Joined: 03 Jun 2012
Total Posts: 5975
23 Oct 2013 07:40 PM
@row the script is right in front of you .-.
Report Abuse
BruceAB12 is not online. BruceAB12
Joined: 19 Jan 2012
Total Posts: 3238
23 Oct 2013 07:42 PM
Well its not an actual reflection but its something quite similar to what a mirror does(You can call this a mirror simulator.) And there are lots of bugs and glitches.
Report Abuse
rowerowe71 is not online. rowerowe71
Joined: 14 Apr 2013
Total Posts: 1999
23 Oct 2013 07:43 PM
SO it makes a working mirror cool!
Report Abuse
BruceAB12 is not online. BruceAB12
Joined: 19 Jan 2012
Total Posts: 3238
23 Oct 2013 07:44 PM
I guess :/

But its not ready so much stuff left to do.
Report Abuse
BruceAB12 is not online. BruceAB12
Joined: 19 Jan 2012
Total Posts: 3238
23 Oct 2013 07:45 PM
but don't call it a mirror.
Report Abuse
BruceAB12 is not online. BruceAB12
Joined: 19 Jan 2012
Total Posts: 3238
23 Oct 2013 07:48 PM
And it currently works only with a mirror the size of (5, 5, 1)
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
23 Oct 2013 07:49 PM
That's more of a character "rotate"

If you want an actually mirror, you could just get all parts from, an angle if 120 or so respective to the lookVector of the mirror and rotate all found objects by math.pi and "place" them on the mirror
Report Abuse
BruceAB12 is not online. BruceAB12
Joined: 19 Jan 2012
Total Posts: 3238
23 Oct 2013 07:51 PM
I never thought of that xP
Report Abuse
BruceAB12 is not online. BruceAB12
Joined: 19 Jan 2012
Total Posts: 3238
23 Oct 2013 07:51 PM
But how would I get all the parts from an angle?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
23 Oct 2013 07:55 PM
multiple raycasts could work
Report Abuse
BruceAB12 is not online. BruceAB12
Joined: 19 Jan 2012
Total Posts: 3238
23 Oct 2013 07:57 PM
Wouldn't that lag?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
23 Oct 2013 07:58 PM
Meh, kind of.
There are better ways
Report Abuse
BruceAB12 is not online. BruceAB12
Joined: 19 Jan 2012
Total Posts: 3238
23 Oct 2013 07:59 PM
Better ways 0.0?
Report Abuse
BruceAB12 is not online. BruceAB12
Joined: 19 Jan 2012
Total Posts: 3238
23 Oct 2013 08:00 PM
How about multiple mirrors?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
23 Oct 2013 08:03 PM
Actually, you can probably use atan2 for all parts in it's lookVector to get the angle of each
Report Abuse
BruceAB12 is not online. BruceAB12
Joined: 19 Jan 2012
Total Posts: 3238
23 Oct 2013 08:03 PM
What is the atan2 you speak of?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
23 Oct 2013 08:06 PM
arc tangent 2
Report Abuse
BruceAB12 is not online. BruceAB12
Joined: 19 Jan 2012
Total Posts: 3238
23 Oct 2013 08:08 PM
I searched it in the wiki. Nothing showed up.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
23 Oct 2013 08:08 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