|
| 17 May 2015 10:58 PM |
| I have already made a inventory UI, a thirst and hunger gui, the tools, the only, and I know it is a stupid question, but I need help with a loot system, so in the selected area (set up as a can-collide invisble part) the selected tools will spawn in that area, please help with this. |
|
|
| Report Abuse |
|
|
|
| 17 May 2015 11:02 PM |
All it needs to do is
clone the tool
spawn it in a certain area within a certain amount of time
and just spawn it randomly within that area |
|
|
| Report Abuse |
|
|
mycheeze
|
  |
| Joined: 27 Jun 2011 |
| Total Posts: 6748 |
|
|
| 17 May 2015 11:05 PM |
local A = game:GetService('ServerStorage'):WaitForChild('Put Name Here'):Clone()
A.CFrame = CFrame.new(Workspace:WaitForChild('Invisible Part').Position))
game:GetService('Debris'):AddItem(A, Time)
You may want to make a table containing all invisible parts, use math.random to randomize which area it spawns in (and another math.random) to offset it from the original coordinates. |
|
|
| Report Abuse |
|
|
|
| 17 May 2015 11:10 PM |
| Could you maybe simplify that a little bit? Where to put it? How to set it up? Thanks. |
|
|
| Report Abuse |
|
|
| |
|
|
| 17 May 2015 11:19 PM |
| Please, I have little scripting knowledge about this subject at all. |
|
|
| Report Abuse |
|
|
mycheeze
|
  |
| Joined: 27 Jun 2011 |
| Total Posts: 6748 |
|
|
| 17 May 2015 11:20 PM |
Take all of your invisible/non-collidable parts and put them in a single model.
Then do the following
local A = Workspace:WaitForChild('Put the model name here'):GetChildren() local B = game:GetService('ServerStorage'):WaitForChild('Put the tool name here'):Clone() B.CFrame = CFrame.new(A[math.random(1, #A)].Position) B.Parent = Workspace |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 17 May 2015 11:21 PM |
local tool1 = game.ServerStorage.Tool1 local tool1Clone = tool1:Clone() tool1Clone.Parent = game.Workspace tool1Clone:MoveTo(game.Workspace.SpawnArea1.Position) wait(math.random(60,120)) tool1Clone:MoveTo(game.Workspace.SpawnArea2.Position) --etc
|
|
|
| Report Abuse |
|
|
|
| 17 May 2015 11:22 PM |
| Thanks guys, that was easy, I couldn't find any info on the internet regarding this. |
|
|
| Report Abuse |
|
|
|
| 17 May 2015 11:27 PM |
| Nevermind, none of these are working I have the script in ServerScripts. |
|
|
| Report Abuse |
|
|
mycheeze
|
  |
| Joined: 27 Jun 2011 |
| Total Posts: 6748 |
|
|
| 17 May 2015 11:29 PM |
Well you need to tell us where you are putting the tools (are all tools in the starterpack/serverstorage?)
You are going to have to chip in things like (where are the invisible spawn parts, tools) and some more bits of information so we can better help you.
S0wwy ;-; |
|
|
| Report Abuse |
|
|
|
| 17 May 2015 11:30 PM |
Toolname = Bacon_Jerky
The tool is in ServerStorage
|
|
|
| Report Abuse |
|
|
|
| 17 May 2015 11:32 PM |
| The Invisible part is simply named "Invisible" it is in the workspace. |
|
|
| Report Abuse |
|
|
| |
|
mycheeze
|
  |
| Joined: 27 Jun 2011 |
| Total Posts: 6748 |
|
|
| 17 May 2015 11:39 PM |
I = Workspace:WaitForChild('Invisible') T = game:GetService('ServerStorage'):WaitForChild('Bacon_Jerky'):Clone()
T.CFrame = CFrame.new( math.random(I.Position.X - I.Size.X/2, I.Position.X + I.Size.X), I.Position.Y, math.random(I.Position.Z - I.Size.Z/2, I.Position.Z + I.Size.Z))
T.Parent = Workspace
This should take the two dimensions being X and Z and calculate a randomized position from any area inside the part, but always being at the same height. |
|
|
| Report Abuse |
|
|
mycheeze
|
  |
| Joined: 27 Jun 2011 |
| Total Posts: 6748 |
|
|
| 17 May 2015 11:39 PM |
oh I forgot, I don't know how to move tools q-q
You are going to have to use something like :MoveTo() or :TranslateTo()
sowwy m8
but the rest sh00d b c0vered |
|
|
| Report Abuse |
|
|
|
| 17 May 2015 11:44 PM |
I have no further knowledge on this subject matter, I don't know anything about tool api, or anything about this, but I'm assuming it should simply be a
Bacon_Jerky.Parent = (the thing)
but thanks, that did not work, so. |
|
|
| Report Abuse |
|
|
|
| 17 May 2015 11:46 PM |
| well, does anyone else have a script. |
|
|
| Report Abuse |
|
|
|
| 17 May 2015 11:50 PM |
| this could be done easily without any advanced scripts, it can be done by having a tool in the storage, then cloning it, then wait() and move it to the area, without any c.frame, or anything like that. |
|
|
| Report Abuse |
|
|
| |
|
|
| 18 May 2015 05:07 AM |
| I dont like you. this forum is for advanced scriptera. gtfo, ill follow you later. |
|
|
| Report Abuse |
|
|