brados123
|
  |
| Joined: 24 Nov 2012 |
| Total Posts: 2143 |
|
|
| 27 Sep 2015 11:27 AM |
how do i insert a script into a instance.new part?
here's the script i got now(the one that creates the part)
function fire() local p = Instance.new("Part") p.Position = script.Parent.Position p.Size = Vector3.new(6.94, 150.48, 8.42) p.BottomSurface = 0 p.TopSurface = 0 p.Name = "TycoonBrick" p.Parent = script.Parent p.Material = script.Parent.Material p.BrickColor = script.Parent.BrickColor Instance.new("CylinderMesh").Parent=p Instance.new("Script").Parent =p
end
while true do wait(4) fire() end
ok, so this script works, but how would i insert a script that when you touch the new part made by the script, it will kill you when you touch it?
Thank you :)
I auto accept Higher rap. Here is my trade window: http://www.roblox.com/Trade/TradeWindow.aspx?TradePartnerID=34773242 |
|
|
| Report Abuse |
|
|
brados123
|
  |
| Joined: 24 Nov 2012 |
| Total Posts: 2143 |
|
|
| 27 Sep 2015 11:36 AM |
bump 1
I auto accept Higher rap. Here is my trade window: http://www.roblox.com/Trade/TradeWindow.aspx?TradePartnerID=34773242 |
|
|
| Report Abuse |
|
|
|
| 27 Sep 2015 12:18 PM |
--// Make sure you have the script ready and parented, also put what you want the script to do in the actual script.
local Script = game:service'Lighting':WaitForChild('InsertedScript') --// Contents
Fire = function() local Part = Instance.new("Part") Part.Position = script.Parent.Position Part.Size = Vector3.new(6.94, 150.48, 8.42) Part.BottomSurface = 0 Part.TopSurface = 0 Part.Name = "TycoonBrick" Part.Parent = script.Parent Part.Material = script.Parent.Material Part.BrickColor = script.Parent.BrickColor local Mesh = Instance.new("CylinderMesh",Part) local Script_Clone = Script:Clone() Script_Clone.Parent = Part end;
while wait() do wait(4) spawn(Fire) end; |
|
|
| Report Abuse |
|
|
brados123
|
  |
| Joined: 24 Nov 2012 |
| Total Posts: 2143 |
|
|
| 27 Sep 2015 12:47 PM |
Does it have to be a local script? I need a regular? |
|
|
| Report Abuse |
|
|
|
| 15 Dec 2015 10:03 PM |
[Very L8 IK but why not?] Ofc not |
|
|
| Report Abuse |
|
|