Can someone tell me what is wrong with this script?
#4
(08-11-2011, 12:21 AM)Qwertygiy Wrote: No, that's my game teleport script, not a World teleport script...

Hang on a moment and I'll post a world-changing script.
[lua]
enabled = true
function OnCollided(hit)
if hit.Parent.Type == "Character" and enabled then
enabled = false
hit.Parent = game:getWorld("outside").World
local player = game.Players:getChild(hit.Parent.Name)
player.Parent = game:getWorld("outside").Players
hit.Position = Vec2D(77.69,63.88)
hit.Parent.Health = 0
enabled = true
end
end

link(script.Parent.Collided, OnCollided)
[/lua]

Now, assuming your new world is named "outside", that should work. If it looks like it just changed position, are your two worlds nearly identical? If so, it probably worked -- you just can't distinguish between the new World and the old one.

Okay, here's the working version:
[lua]enabled = true
function OnCollided(hit)
if hit.Parent.Type == "Character" and enabled then
enabled = false
hit.Parent = game:getWorld("outside").World
local player = game.Players:getChild(hit.Parent.Name)
player.Parent = game:getWorld("outside").Players
hit.Position = Vec2D(77.69,63.88)
enabled = true
end
end

link(script.Parent.Collided, OnCollided)
[/lua]

I think you forgot to add a parent Tongue
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)