|
| 14 Sep 2016 08:05 AM |
so if i have a script like this:
local coord = game.Workspace.Brick.CFrame
how can i acced coord and add 10 more valeu by t heigt the y coord
thx if you help |
|
|
| Report Abuse |
|
|
ManxFox
|
  |
| Joined: 12 Nov 2008 |
| Total Posts: 227 |
|
|
| 14 Sep 2016 08:06 AM |
... I'm sorry, but.. I want to try and help, but I don't understand what you're asking ._.
|
|
|
| Report Abuse |
|
|
|
| 14 Sep 2016 08:09 AM |
so if i have a variable named coord with coordinates of a brick.
how can i make the height inaside the variable so it its 10 more like this
local coord = game.Workspace.Brick.CFrame
coord.CFrame.y = coord.CFrame.y +10
maybe if you see this younderstand what i try to do |
|
|
| Report Abuse |
|
|
ManxFox
|
  |
| Joined: 12 Nov 2008 |
| Total Posts: 227 |
|
|
| 14 Sep 2016 08:14 AM |
you want this:
local part = game.Workspace.Part
part.CFrame = CFrame.new(0,10,0) --< 10 being for adding 10 to the Y axis
|
|
|
| Report Abuse |
|
|
|
| 14 Sep 2016 08:24 AM |
what i wanna do is that my mouse gonna check or he touched a block with the name place
if yes then he gonna give a model th same cframe as the cframe of the brick my mouse touch.
but i need to add 10 more to the cframe y axis of the model.
i have a wrking script but i cannot add that 10 more to the y axis |
|
|
| Report Abuse |
|
|
ManxFox
|
  |
| Joined: 12 Nov 2008 |
| Total Posts: 227 |
|
|
| 14 Sep 2016 08:26 AM |
like I said, if the rest is working, the CFrame.new(0,10,0) should do it
|
|
|
| Report Abuse |
|
|
|
| 14 Sep 2016 08:29 AM |
srry but i dont know how to assing it to my script.
can u say please here is my script
_G.i = 0 local m = game.Players.LocalPlayer:GetMouse() m.Move:connect(function() if _G.i == 0 then print(m.Target.Position) print(m.Target.Name) if m.Target.Name == "place" then local coord = m.Target.Position local model = game.Workspace.Model local initial = CFrame.new(coord) model:SetPrimaryPartCFrame(initial) local Mouse = game.Players.LocalPlayer:GetMouse(); Mouse.Button1Down:connect(function() _G.i = 1 end) end end end) |
|
|
| Report Abuse |
|
|
ManxFox
|
  |
| Joined: 12 Nov 2008 |
| Total Posts: 227 |
|
|
| 14 Sep 2016 08:34 AM |
Okay, if I'm honest, I don't even know how that script is working.
I feel like your functions and a lot of your variables are wrong
if it's a model, you could try something like:
model:TranslateBy(Vector3.new(0,10,0))
put that in when you want to move the model up by 10
that may or may not work, I'm not sure
|
|
|
| Report Abuse |
|
|
Mr_Gibus
|
  |
| Joined: 17 Jun 2012 |
| Total Posts: 368 |
|
|
| 14 Sep 2016 08:38 AM |
| I didn't even know about TranslateBy. xD I have been using CFrame to move models dang.... |
|
|
| Report Abuse |
|
|
|
| 14 Sep 2016 08:38 AM |
| yes it works thx that you helped me |
|
|
| Report Abuse |
|
|
ManxFox
|
  |
| Joined: 12 Nov 2008 |
| Total Posts: 227 |
|
|
| 14 Sep 2016 08:39 AM |
tbh, I've never USED translateby, I only found out about it because I was using MoveTo to move players around a map :P
but hey if it works it works, np ^^
|
|
|
| Report Abuse |
|
|
|
| 14 Sep 2016 09:07 AM |
| y cannot be assigned to because roblox prevented it in the cframe metatable |
|
|
| Report Abuse |
|
|
ManxFox
|
  |
| Joined: 12 Nov 2008 |
| Total Posts: 227 |
|
|
| 14 Sep 2016 09:08 AM |
wat I thought the y was the second value in CFrame.new() !??!
|
|
|
| Report Abuse |
|
|
|
| 14 Sep 2016 09:38 AM |
| inv me to multi studio okay? |
|
|
| Report Abuse |
|
|
|
| 14 Sep 2016 09:39 AM |
| it is but you cannot assign it a value, you can only create a new cframe table with its metatable |
|
|
| Report Abuse |
|
|
ManxFox
|
  |
| Joined: 12 Nov 2008 |
| Total Posts: 227 |
|
| |
|