Welcome, Guest |
You have to register before you can post on our site.
|
Forum Statistics |
» Members: 8,079
» Latest member: seanac11
» Forum threads: 10,350
» Forum posts: 91,276
Full Statistics
|
Online Users |
There are currently 226 online users. » 0 Member(s) | 223 Guest(s) Bing, Google, Yandex
|
Latest Threads |
I'm leaving the site too....
Forum: 2DWorlds Discussion
Last Post: Jacob_
07-03-2023, 04:59 AM
» Replies: 12
» Views: 6,325
|
hi there.
Forum: 2DWorlds Discussion
Last Post: Jacob_
01-03-2020, 04:30 AM
» Replies: 1
» Views: 745
|
obroke
Forum: Current Games
Last Post: FrancisSah
09-06-2017, 10:11 AM
» Replies: 0
» Views: 20,529
|
fcouldn't
Forum: Current Games
Last Post: FrancisSah
09-06-2017, 09:02 AM
» Replies: 0
» Views: 8,237
|
qhow
Forum: Current Games
Last Post: PhilipShums
09-06-2017, 07:25 AM
» Replies: 0
» Views: 2,121
|
zstone
Forum: Current Games
Last Post: TimothyTox
09-06-2017, 07:03 AM
» Replies: 0
» Views: 985
|
vbit
Forum: Current Games
Last Post: FrancisSah
09-06-2017, 03:00 AM
» Replies: 0
» Views: 966
|
sildenafil 100 mg sandoz
Forum: Current Games
Last Post: RichardLen
09-06-2017, 12:28 AM
» Replies: 0
» Views: 1,178
|
mhis
Forum: Current Games
Last Post: TimothyTox
09-05-2017, 04:09 PM
» Replies: 0
» Views: 990
|
sildenafil citrate 100mg ...
Forum: Current Games
Last Post: Waltertog
09-05-2017, 12:27 PM
» Replies: 0
» Views: 943
|
|
|
There seems to be a rise in bots lately |
Posted by: Fat_Sacks - 12-26-2011, 10:12 AM - Forum: Moderator Discussion
- Replies (1)
|
 |
Guys, I don't know if you noticed, but there seems to be a bit more bots coming onto the site, just keep your eyes pealed, and make sure to delete the posts made by the bots. Remove possible bot siggies aswel through their profile page editor thing.
|
|
|
My fish keeps drowning when it reaches the center of water. |
Posted by: Qwertygiy - 12-26-2011, 01:25 AM - Forum: Scripting
- Replies (1)
|
 |
It correctly moves the fish back to water when it isn't in water (and there's water in the world for it to swim to), but whenever it reaches near the X-center of the water,
fish Wrote:1
FISH IS DYING GARGGGLEPTDDD
1
FISH IS DYING GARGGGLEPTDDD
1
FISH IS DYING GARGGGLEPTDDD
(1 is the number of Water blocks in the world.)
The function that drives me nuts is iNeedTheWater:
[lua]
local scented = false
function find()
local players = game.Players:getChildren()
local closest = nil
local distance = 25 --Feel free to change this value; it's how far away they can "smell" players
for q = 1, #players do
if players[q].Character and players[q].Character:getChild("Body") then
if players[q].Character.Body.Position ub(script.Parent.Position).length < distance then
closest = players[q].Character.Body
distance = players[q].Character.Body.Position ub(script.Parent.Position).length
end end end
if iNeedTheWater() == false then
if closest then
swim(closest.Position)
scented = true
else
swim(Vec2D(math.random(script.Parent.Position.x - 5.01), math.random(script.Parent.Position.x + 5.01)))
scented = false
end
else
swim(findTheWater().Position)
end
end
function swim(target)
local ecks = 0
local why = 0
local vel = script.Parent:getChild("VelocityController")
if target.x > script.Parent.Position.x then
ecks = 3
script.Parent:getChild("FISHEEE").FlipX = true
else
ecks = -3
script.Parent:getChild("FISHEEE").FlipX = false
end
if target.y > script.Parent.Position.y then
why = 1.5
else
why = -2
end
vel.Velocity = Vec2D(ecks, why)
end
function checkForWater(parental, tabull)
local items = parental:getChildren()
for q = 1, #items do
if items[q]:isA("Water") then
table.insert(tabull, items[q])
else
tabull = checkForWater(items[q], tabull)
end
end
return tabull
end
function findTheWater()
local waterz = checkForWater(game.World, {})
if #waterz > 0 then
print(#waterz)
local closewater = nil
local nearest = 1000
for e = 1, #waterz do
if waterz[e].Position ub(script.Parent.Position).length < nearest then
closewater = waterz[e]
nearest = waterz[e].Position ub(script.Parent.Position).length
end end
if closewater then
return closewater
end
end
end
function iNeedTheWater()
local watery = findTheWater()
local dying = false
if watery then
if script.Parent.Position.x > watery.Position.x and script.Parent.Position.x - watery.Position.x >= 5 then
if script.Parent.Position.x - (watery.Size.x * 0.5) > watery.Position.x then
dying = true
end
elseif script.Parent.Position.x < watery.Position.x and watery.Position.x - script.Parent.Position.x >= 5 then
if watery.Position.x - (watery.Size.x * 0.5) < script.Parent.Position.x then
dying = true
end
end
if script.Parent.Position.y > watery.Position.y and script.Parent.Position.y - watery.Position.y >= 5 then
if script.Parent.Position.y - (watery.Size.y * 0.5) > watery.Position.y then
dying = true
end
elseif script.Parent.Position.y < watery.Position.y and watery.Position.y - script.Parent.Position.y >= 5 then
if watery.Position.y - (watery.Size.y * 0.5) < script.Parent.Position.y then
dying = true
end
end
if dying == true then
print("FISH IS DYING GLARGLEPTHDDD")
return true
else
return false
end
end
end
while true do
if scented then
sleep(0.05)
else
sleep(0.5)
end
find()
if script.Parent:getChild("FISHEEE").Image == "http://i41.tinypic.com/35crcbs.png" then
script.Parent:getChild("FISHEEE").Image = "http://i42.tinypic.com/25qg9yb.png"
else
script.Parent:getChild("FISHEEE").Image = "http://i41.tinypic.com/35crcbs.png"
end
end
[/lua]
|
|
|
|