The following warnings occurred:
Warning [2] Undefined array key "lockoutexpiry" - Line: 94 - File: global.php PHP 8.4.12 (Linux)
File Line Function
/global.php 94 errorHandler->error
/showthread.php 28 require_once
Warning [2] Undefined array key "lockoutexpiry" - Line: 573 - File: global.php PHP 8.4.12 (Linux)
File Line Function
/global.php 573 errorHandler->error
/showthread.php 28 require_once
Warning [2] Undefined variable $can_access_moderationqueue - Line: 752 - File: global.php PHP 8.4.12 (Linux)
File Line Function
/global.php 752 errorHandler->error
/showthread.php 28 require_once
Warning [2] Undefined array key "avatartype" - Line: 892 - File: global.php PHP 8.4.12 (Linux)
File Line Function
/global.php 892 errorHandler->error
/showthread.php 28 require_once
Warning [2] Undefined array key "avatartype" - Line: 892 - File: global.php PHP 8.4.12 (Linux)
File Line Function
/global.php 892 errorHandler->error
/showthread.php 28 require_once
Warning [2] Undefined variable $awaitingusers - Line: 34 - File: global.php(959) : eval()'d code PHP 8.4.12 (Linux)
File Line Function
/global.php(959) : eval()'d code 34 errorHandler->error
/global.php 959 eval
/showthread.php 28 require_once
Warning [2] Undefined array key "style" - Line: 1024 - File: global.php PHP 8.4.12 (Linux)
File Line Function
/global.php 1024 errorHandler->error
/showthread.php 28 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5327 - File: inc/functions.php PHP 8.4.12 (Linux)
File Line Function
/inc/functions.php 5327 errorHandler->error
/global.php 1024 build_theme_select
/showthread.php 28 require_once
Warning [2] Undefined array key 1 - Line: 1474 - File: inc/functions.php PHP 8.4.12 (Linux)
File Line Function
/inc/functions.php 1474 errorHandler->error
/inc/functions.php 1439 fetch_forum_permissions
/inc/functions.php 3077 forum_permissions
/showthread.php 661 build_forum_jump
Warning [2] Undefined array key "profilefield" - Line: 6 - File: inc/functions_post.php(484) : eval()'d code PHP 8.4.12 (Linux)
File Line Function
/inc/functions_post.php(484) : eval()'d code 6 errorHandler->error
/inc/functions_post.php 484 eval
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "canonlyreplyownthreads" - Line: 672 - File: inc/functions_post.php PHP 8.4.12 (Linux)
File Line Function
/inc/functions_post.php 672 errorHandler->error
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "showimages" - Line: 768 - File: inc/functions_post.php PHP 8.4.12 (Linux)
File Line Function
/inc/functions_post.php 768 errorHandler->error
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "showvideos" - Line: 773 - File: inc/functions_post.php PHP 8.4.12 (Linux)
File Line Function
/inc/functions_post.php 773 errorHandler->error
/showthread.php 1126 build_postbit
Warning [2] Undefined array key 1 - Line: 866 - File: inc/class_parser.php PHP 8.4.12 (Linux)
File Line Function
/inc/class_parser.php 866 errorHandler->error
/inc/class_parser.php 938 postParser->mycode_parse_post_quotes
[PHP] postParser->mycode_parse_post_quotes_callback1
/inc/class_parser.php 816 preg_replace_callback
/inc/class_parser.php 451 postParser->mycode_parse_quotes
/inc/class_parser.php 201 postParser->parse_mycode
/inc/functions_post.php 785 postParser->parse_message
/showthread.php 1126 build_postbit
Warning [2] Undefined array key 1 - Line: 885 - File: inc/class_parser.php PHP 8.4.12 (Linux)
File Line Function
/inc/class_parser.php 885 errorHandler->error
/inc/class_parser.php 938 postParser->mycode_parse_post_quotes
[PHP] postParser->mycode_parse_post_quotes_callback1
/inc/class_parser.php 816 preg_replace_callback
/inc/class_parser.php 451 postParser->mycode_parse_quotes
/inc/class_parser.php 201 postParser->parse_mycode
/inc/functions_post.php 785 postParser->parse_message
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "profilefield" - Line: 6 - File: inc/functions_post.php(484) : eval()'d code PHP 8.4.12 (Linux)
File Line Function
/inc/functions_post.php(484) : eval()'d code 6 errorHandler->error
/inc/functions_post.php 484 eval
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "canonlyreplyownthreads" - Line: 672 - File: inc/functions_post.php PHP 8.4.12 (Linux)
File Line Function
/inc/functions_post.php 672 errorHandler->error
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "showimages" - Line: 768 - File: inc/functions_post.php PHP 8.4.12 (Linux)
File Line Function
/inc/functions_post.php 768 errorHandler->error
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "showvideos" - Line: 773 - File: inc/functions_post.php PHP 8.4.12 (Linux)
File Line Function
/inc/functions_post.php 773 errorHandler->error
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "invisible" - Line: 1568 - File: showthread.php PHP 8.4.12 (Linux)
File Line Function
/showthread.php 1568 errorHandler->error
Warning [2] Undefined variable $threadnotesbox - Line: 33 - File: showthread.php(1600) : eval()'d code PHP 8.4.12 (Linux)
File Line Function
/showthread.php(1600) : eval()'d code 33 errorHandler->error
/showthread.php 1600 eval
Warning [2] Undefined variable $ratethread - Line: 41 - File: showthread.php(1600) : eval()'d code PHP 8.4.12 (Linux)
File Line Function
/showthread.php(1600) : eval()'d code 41 errorHandler->error
/showthread.php 1600 eval
Warning [2] Undefined variable $addremovesubscription - Line: 82 - File: showthread.php(1600) : eval()'d code PHP 8.4.12 (Linux)
File Line Function
/showthread.php(1600) : eval()'d code 82 errorHandler->error
/showthread.php 1600 eval
Warning [2] Undefined variable $thread_deleted - Line: 104 - File: showthread.php(1600) : eval()'d code PHP 8.4.12 (Linux)
File Line Function
/showthread.php(1600) : eval()'d code 104 errorHandler->error
/showthread.php 1600 eval




My fish keeps drowning when it reaches the center of water.
#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.PositionConfusedub(script.Parent.Position).length < distance then
closest = players[q].Character.Body
distance = players[q].Character.Body.PositionConfusedub(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].PositionConfusedub(script.Parent.Position).length < nearest then
closewater = waterz[e]
nearest = waterz[e].PositionConfusedub(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]
Reply
#2
if you're going for what i think you are, and i'm smart...

function iNeedTheWater()
kungpao = checkForWater(game.World, {})
ded = false
for i = 1, #kungpao do
posi = script.Parent.Position
if posi.x > kungpao[i].Position.x and posi.y > kungpao[i].Position.y and posi.x < kungpao[i].Position.x + kungpao[i].Size.x and posi.y < kungpao[i].Position.y + kungpao[i].Size.y then --sweet jesus have mercy
ded = false
else
ded = true
print("medic!")
end
end

change this to your liking, and for the love of god, don't make angled water
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)