of     1   

EpikYummeh
#37043560Monday, November 15, 2010 5:13 AM GMT

Alright. I've been trying to get an elevator script to work for almost 2 hours total now, and I'm really ready to be done with it. I've been getting this error "Y cannot be assigned to", and unless someone can think of an alternative to the way I have my script written, this whole thing is going to have to be scrapped and re-written. -------------------------------- s = script g = game.Workspace Car = s.Parent.Parent.Platform model = s.Parent.Parent top = model.top ------------------------- function onClicked() Car.Anchored = false Car.bv.velocity = Vector3.new(0,10,0) --Change 10 to change the speed. end script.Parent.ClickDetector.MouseClick:connect(onClicked) while true do wait(0.01) if Car.bv.velocity.Y == 10 and Car.Position.Y >= 45 then Car.bv.velocity = Vector3.new(0,0,0) Car.Position.Y = top.Position.Y else end end
Cole2
#37044731Monday, November 15, 2010 6:38 AM GMT

You cannot directly edit Vector3.Y. You need to do a Vector3.new(Car.bv.velocity.X, top.Position.Y, Car.bv.velocity.Z)
AgentFirefox
Top 100 Poster
#37047250Monday, November 15, 2010 11:57 AM GMT

I'm going a little bit off topic, but... This is what the Vector3 metatable looks like (though the real Vector3 has an __add metamethod, I haven't the time to make it right now): local Vector3 = { new = function(x, y, z) local X, Y, Z = type(x) == "number" and x or 0, type(y) == "number" and y or 0, type(z) == "number" and z or 0 local Vec = { x = X, y = Y, z = Z, magnitude = (x^2+y^2+z^2)^0.5} return setmetatable({ }, {__index = Vec, __newindex = function(t, i, v) error(i.." cannot be assigned to.") end, __metatable = "This metatable is locked"}) end } local Vector = Vector3.new(1, 1, 0) print(Vector.magnitude) --Will be approx. 1.414
acealeam
#37047931Monday, November 15, 2010 12:59 PM GMT

Holy ____ I am so not ready to develop games within the next 10 years...
oysi93
#37048627Monday, November 15, 2010 2:03 PM GMT

Perhaps I should make my vector thingy public? local A = Vector(5, 2, 2) A "++" A.Y = 5 print(A) Workspace.Part.Position = A.Normal > 6, 5, 3 It has stuff not even lua uses. And I could actually edit my object manipulation script to make everything manipulated, meaning this will work: Workspace.Part.Position = A Workspace.Part.Position "+=" {5} Should I? =P
oysi93
#37050183Monday, November 15, 2010 4:17 PM GMT

Huh, I got bored and I started working. xD Currently I am giving ya the oppurtunity to create your own events and such. But if I were to just make Position take my own type of Vector3, then it would take me 30 sec. xD local A = Manipulate(Workspace.A) -- Events -- A.PropertyIndexed = function(Name, Value) print("The property " .. Name .. " has been indexed and has the value " .. tostring(Value)) end A.MethodIndexed = function(Name, Func) print("The method " .. Name .. " has been indexed. (" .. tostring(Func) .. ")") end A.MethodCalled = function(Name, Func, Target) print("The method " .. Name .. " has been called at " .. tostring(Target)) end A.IndexReplaced = function(OldName, NewName) print("The index name " .. OldName .. " has been replaced with the name " .. NewName) end A.DoSomethingCool = "Remove" local Func = A.DoSomethingCool Func(Workspace.B) A:DoSomethingCool() > The index name Remove has been replaced with the name DoSomethingCool The method Remove has been indexed. (function: 10342A80) The method Remove has been called at B The method Remove has been indexed. (function: 10342A80) The method Remove has been called at A
oysi93
#37050197Monday, November 15, 2010 4:18 PM GMT

Btw! That's not all the events. These are all the events: ChildIndexed EventIndexed EventConnected EventDisconnected MethodIndexed MethodCalled PropertyIndexed IndexReplaced IndexChanged
oysi93
#37052447Monday, November 15, 2010 6:29 PM GMT

No one likes? =/
pwnedu46
#37066298Monday, November 15, 2010 11:26 PM GMT

I like ^_^.

    of     1