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: RGC Hackathon Retracing your footsteps

Previous Thread :: Next Thread 
Iteron is not online. Iteron
Joined: 18 Jun 2012
Total Posts: 150
25 Jul 2012 05:07 AM
I'm trying to do the RGC Hackathon task: Retracing your footsteps.

-Create a tool

-When the tool is equipped, every 3 seconds create an Anchored, CanCollide=false part where the player is standing

I am currently trying to get the player's position and to break the loop when the tool is deselected but I can't to do, how would I?

My script: (Using a hopperbin)

script.Parent.Selected:connect(function()
while true do
part = Instance.new("Part", workspace)
part.Size = Vector3.new(2,2,2)
part.CanCollide = false
part.Anchored = true
wait(2)
end
end)
Report Abuse
Cheater is not online. Cheater
Joined: 29 Jun 2007
Total Posts: 5258
25 Jul 2012 05:19 AM
You want the position of the player?

Player
-Backpack
--Hopperbin
---Script

Maybe the script is inside the Hopperbin already. Don't use them that much.
Just use some parent's.
Report Abuse
Iteron is not online. Iteron
Joined: 18 Jun 2012
Total Posts: 150
25 Jul 2012 05:28 AM
But doesn't it work like this:

-Game
--Workspace
---Player
----Position
--Players
---Player
----Backpack
-----Hopperbin
------Script

The position value is in a different area, Workspace rather than Player. I tried doing things like:

name = script.Parent.Parent.Parent.Name
position = Workspace.name.Position

But I've had no luck
Report Abuse
Cheater is not online. Cheater
Joined: 29 Jun 2007
Total Posts: 5258
25 Jul 2012 05:30 AM
Yours is wrong aswell.

position = script.Parent.Parent.Parent.Character.Torso.Position
Report Abuse
Iteron is not online. Iteron
Joined: 18 Jun 2012
Total Posts: 150
25 Jul 2012 05:33 AM
There is no Torso in Character. Character is in "Players" and players don't have torsos. The torsos are found in Workspace which I'm having troubles with because backpack isn't contained in workspace but in the Players area
Report Abuse
Cheater is not online. Cheater
Joined: 29 Jun 2007
Total Posts: 5258
25 Jul 2012 05:35 AM
Nope, it works.

http://wiki.roblox.com/index.php/Character
Report Abuse
Cheater is not online. Cheater
Joined: 29 Jun 2007
Total Posts: 5258
25 Jul 2012 05:36 AM
print(game.Workspace.Iteron.Torso.Position = game.Players.Iteron.Character.Torso.Position)
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
25 Jul 2012 05:37 AM
I totaly failed that one at the real Hackathon xD
Report Abuse
Iteron is not online. Iteron
Joined: 18 Jun 2012
Total Posts: 150
25 Jul 2012 05:39 AM
I tried adding what you said but it just place the bricks in one at the centre of the base plate still:


local pos = script.Parent.Parent.Parent.Character.Torso.Position

script.Parent.Selected:connect(function()
while true do
part = Instance.new("Part", workspace)
part.Size = Vector3.new(2,2,2)
part.CanCollide = false
part.Anchored = true
part.Position = pos
wait(2)
end
end)
Report Abuse
Cheater is not online. Cheater
Joined: 29 Jun 2007
Total Posts: 5258
25 Jul 2012 05:40 AM
local pos = script.Parent.Parent.Parent.Character.Torso.Position

script.Parent.Selected:connect(function()
while true do
part = Instance.new("Part", workspace)
part.Size = Vector3.new(2,2,2)
part.CanCollide = false
part.Anchored = true
part.Position = Vector3.new(pos)
wait(2)
end
end)
Report Abuse
Iteron is not online. Iteron
Joined: 18 Jun 2012
Total Posts: 150
25 Jul 2012 05:44 AM
I'm getting this error also now

Players.Player.Backpack.Trail.Script:1: attempt to index field 'Character' (a nil value)
Report Abuse
Cheater is not online. Cheater
Joined: 29 Jun 2007
Total Posts: 5258
25 Jul 2012 05:46 AM
Wut the.
Report Abuse
Cheater is not online. Cheater
Joined: 29 Jun 2007
Total Posts: 5258
25 Jul 2012 05:47 AM
My faulth.

script.Parent.Selected:connect(function()
while true do
local pos = script.Parent.Parent.Parent.Character.Torso.Position
part = Instance.new("Part", workspace)
part.Size = Vector3.new(2,2,2)
part.CanCollide = false
part.Anchored = true
part.Position = Vector3.new(pos)
wait(2)
end
end)
Report Abuse
Iteron is not online. Iteron
Joined: 18 Jun 2012
Total Posts: 150
25 Jul 2012 05:48 AM
It does still work though, it doesn't stop the script from working.

However the position doesn't work.
Report Abuse
Cheater is not online. Cheater
Joined: 29 Jun 2007
Total Posts: 5258
25 Jul 2012 05:48 AM
Try the newer version.
Report Abuse
Iteron is not online. Iteron
Joined: 18 Jun 2012
Total Posts: 150
25 Jul 2012 05:50 AM
Ok so with the newest version I recieve no errors, but the positioning still doesn't work.
Report Abuse
Cheater is not online. Cheater
Joined: 29 Jun 2007
Total Posts: 5258
25 Jul 2012 05:52 AM
What happens?
Report Abuse
Cheater is not online. Cheater
Joined: 29 Jun 2007
Total Posts: 5258
25 Jul 2012 05:52 AM
This could also work:

script.Parent.Selected:connect(function()
while true do
local pos = script.Parent.Parent.Parent.Character.Torso.Position
part = Instance.new("Part", workspace)
part.Size = Vector3.new(2,2,2)
part.CanCollide = false
part.Anchored = true
part.CFrame = CFrame.new(pos)
wait(2)
end
end)
Report Abuse
Iteron is not online. Iteron
Joined: 18 Jun 2012
Total Posts: 150
25 Jul 2012 05:53 AM
So when I select the tool it spawns a part as wanted but a (0,0,0) not at the player's position. The script has no errors but just doesn't seems to go to the player's position. This is using your latest script.
Report Abuse
Cheater is not online. Cheater
Joined: 29 Jun 2007
Total Posts: 5258
25 Jul 2012 05:54 AM
What about my new latest script?
Report Abuse
Cheater is not online. Cheater
Joined: 29 Jun 2007
Total Posts: 5258
25 Jul 2012 05:56 AM
Renewed:

script.Parent.Selected:connect(function()
while true do
pos = script.Parent.Parent.Parent.Character.Torso.Position
part = Instance.new("Part", workspace)
part.Size = Vector3.new(2,2,2)
part.CanCollide = false
part.Anchored = true
part.CFrame = CFrame.new(pos)
wait(2)
end
end)
Report Abuse
Iteron is not online. Iteron
Joined: 18 Jun 2012
Total Posts: 150
25 Jul 2012 05:56 AM
Using the CFrame it worked. Might be because Vector3 cannot go through objects and didn't like spawning in the player.

Perhaps


local x = script.Parent.Parent.Parent.Character.Torso.Position.X
local y = script.Parent.Parent.Parent.Character.Torso.Position.Y
local z = script.Parent.Parent.Parent.Character.Torso.Position.Z
Vector3.new(x,y+5,z)

would work.

Also I want it to stop spawning bricks after I deselect the tool.
Report Abuse
Cheater is not online. Cheater
Joined: 29 Jun 2007
Total Posts: 5258
25 Jul 2012 05:58 AM
script.Parent.Selected:connect(function()
while script.Parent.Selected do --lol, I don't think it'll work but give it a try
pos = script.Parent.Parent.Parent.Character.Torso.Position
part = Instance.new("Part", workspace)
part.Size = Vector3.new(2,2,2)
part.CanCollide = false
part.Anchored = true
part.CFrame = CFrame.new(pos)
wait(2)
end
end)
Report Abuse
Iteron is not online. Iteron
Joined: 18 Jun 2012
Total Posts: 150
25 Jul 2012 06:02 AM
0 errors but this doesn't work unfortunantly.

Continues as if nothing has changed
Report Abuse
Cheater is not online. Cheater
Joined: 29 Jun 2007
Total Posts: 5258
25 Jul 2012 06:05 AM
val = 0

script.Parent.Selected:connect(function()
val = 1
while val == 1 do
pos = script.Parent.Parent.Parent.Character.Torso.Position
part = Instance.new("Part", workspace)
part.Size = Vector3.new(2,2,2)
part.CanCollide = false
part.Anchored = true
part.CFrame = CFrame.new(pos)
wait(2)
end
end)

script.Parent.Deselected:connect(function()
val = 0
end)
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