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 » Scripters
Home Search
 

Re: cframe edit

Previous Thread :: Next Thread 
yentedolfijn is not online. yentedolfijn
Joined: 16 Apr 2014
Total Posts: 276
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 is not online. 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
yentedolfijn is not online. yentedolfijn
Joined: 16 Apr 2014
Total Posts: 276
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 is not online. 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
yentedolfijn is not online. yentedolfijn
Joined: 16 Apr 2014
Total Posts: 276
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 is not online. 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
yentedolfijn is not online. yentedolfijn
Joined: 16 Apr 2014
Total Posts: 276
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 is not online. 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 is online. 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
yentedolfijn is not online. yentedolfijn
Joined: 16 Apr 2014
Total Posts: 276
14 Sep 2016 08:38 AM
yes it works thx that you helped me
Report Abuse
ManxFox is not online. 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
Fluffy_Husky is not online. Fluffy_Husky
Joined: 23 May 2016
Total Posts: 763
14 Sep 2016 09:07 AM
y cannot be assigned to because roblox prevented it in the cframe metatable
Report Abuse
ManxFox is not online. 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
myactivetestplace is not online. myactivetestplace
Joined: 11 Jul 2015
Total Posts: 3733
14 Sep 2016 09:38 AM
inv me to multi studio okay?
Report Abuse
Fluffy_Husky is not online. Fluffy_Husky
Joined: 23 May 2016
Total Posts: 763
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 is not online. ManxFox
Joined: 12 Nov 2008
Total Posts: 227
14 Sep 2016 09:43 AM
Oh that's crap


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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