|
| 16 Aug 2017 05:47 PM |
| If you have played miner's haven before, i'm trying to make a teleporter like the ones in that game. When a block hits the teleport sender it automatically appears at the receiver and doesn't work in both directions. I want to make something like that but i cant figure out how. Any help? |
|
|
| Report Abuse |
|
|
| |
|
Joz2015
|
  |
| Joined: 03 Nov 2015 |
| Total Posts: 3154 |
|
|
| 16 Aug 2017 05:58 PM |
| http://wiki.roblox.com/index.php?title=API:Class/BasePart/Touched |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2017 07:17 PM |
for i,v in pairs(script.Parent.Parent.TeleporterConveyor:GetChildren()) do if v.Name == "Teleporter" then v.Touched:connect(function(Part) then Part.CFrame = CFrame.new(0, 50, 0) end) end end
i tried this but i dont know why it doesnt work :/ Can someone help or explain how to fix this? |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2017 07:28 PM |
bump also im new to scripting so this is pretty confusing :/ |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2017 07:46 PM |
| try giving the brick a humanoid then disable the health settings and try to target the humanoid of the inside of the part i guess either that or Check out berezaa tycoon kit to see how its done |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2017 07:47 PM |
| Found it.. you need to do the part where the thing gets touched fir st. Then you do the checking. Also do not put "then" after v.Touched:connect(function(Part) . I think the ")" goes with the last "end", not first end. Lastly, pairs is i pairs(no spaces) not pairs. Tell me if you need help or doesn't work. |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2017 07:50 PM |
| you could also check out Zed's Tycoon Kit or Fvii's Tycoon Kit but idk if they did a step by step youtube tutorial for using their kits like berezaa did |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2017 08:08 PM |
for i,v in pairs(script.Parent.Parent.TeleporterConveyor:GetChildren()) do v.Touched:connect(function(Part) if v.Name == "Teleporter" then Part.CFrame = CFrame.new(0, 50, 0) end end end)
this is what i have now. still not sure if its correct or not. im a noob sorry. |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2017 08:56 PM |
| Looks pretty good, it should work. |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2017 08:57 PM |
| btw pairs = i pairs(no spaces) |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2017 09:06 PM |
it isnt working still. what do you mean by i pairs? do you mean this?
for i,v ipairs(script.Parent... instead of for i,v in pairs(script.Parent...
(type in pairs as ipairs?) |
|
|
| Report Abuse |
|
|
| |
|
|
| 17 Aug 2017 10:41 AM |
Just to be clear this is what you mean:
for i,v ipairs(script.Parent.Parent.TeleporterConveyor:GetChildren()) do v.Touched:connect(function(Part) if v.Name == "Teleporter" then Part.CFrame = CFrame.new(0, 50, 0) end end end)
Correct? |
|
|
| Report Abuse |
|
|
| |
|
| |
|