[ Suggestion ] - Make the connections like roblox style and add findFirstChild
#1
since this script

Code:
while true do
p = create("Box");
p.Position = Vec2D(math.random(400,600),100)
p.Size = Vec2D(5, 5)
p.Color = Color(math.random(0, 255), math.random(0, 255), math.random(0, 255))
p.Parent = game.World
p.Fixed = false
s = create("Script")
s.Source = "sleep(5); while script.Parent.Transparency < 1 do script.Parent.Transparency = script.Parent.Transparency + 0.2; sleep(0.1); end; script.Parent:remove();"
s.Parent = p
sa = create("Script")
sa.Source = "link(script.Parent.Collided, function(touch) if touch.Name ~= "Ground" and touch.Score ~= nil then script.Parent:remove(); end end)"
sa.Parent = p
tex = create("Texture")
tex.Image "http://image.shutterstock.com/display_pic_with_logo/251461/251461,1236423088,1/stock-photo-closeup-waffle-texture-to-background-26195983.jpg"
tex.Parent = p
sleep(1)
end

requires findFirstChild, it is needed in the LUA Database and can you make the connections similar in ROBLOX, so it can be more easier?
Reply
#2
The latest update has a getChild() that works like findFirstChild() in Roblox.

And the connections will have to stay this way for now. Roblox uses one Lua environment with multiple threads; the Lua library I used doesn't support threads so each script has a separate Lua environment. If a member function was used to connect events, then the game wouldn't know what Lua environment to run the event script on, if that makes any sense.
Reply
#3
well that fixes everything about the connectors, but what bugs me most is this:

[2010-10-16 17:34:14] Tried to call nil

when you do a if not statement

example:
Code:
sa.Source = "link(script.Parent.Collided, function(touch) if touch.Name ~= "Ground" and touch.Score ~= nil then script.Parent:remove(); end end)"
Reply
#4
Is Score a value object? If it is you have to get the Value property (touch.Score.Value).

Not statements shouldn't cause errors.
Reply
#5
even with the score out, it still says the same error
Reply
#6
I finally realized what the problem is, you have to escape quotes in strings with backslashes, otherwise it gets confused.

Code:
sa.Source = "link(script.Parent.Collided, function(touch) if touch.Name ~= \"Ground\" and touch.Score ~= nil then script.Parent:remove(); end end)
Reply
#7
[spam removed]
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)