• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

offset of spells

Thorn

Spriting since 2013
Joined
Sep 24, 2012
Messages
2,203
Solutions
1
Reaction score
923
Location
Chile
Hello guys, im trying to set big spells into player's position. i have tried many different offsets numbers but i can't get it in my position, this is how it looks:
4823534f99e93729cfc815cf247650e6.png


does anyone know how to center it to my pos?
 
local pos = player:getPosition()
> pos.x = pos.x + 1 or + 2
> pos.y = pos.y + 1 or + 2
testing one per one
Any number is considered to always be true, yes even 0, so if pos.x were a negative number or pos.x + 1 equaled to 0, the condition would evaluate to be true.

The or +2 would never execute and if pos.x did not exist or was nil then you would get an error and the script would stop right there.
Same thing goes for pos.y

It is incorrect to say (+ 1 or + 2), when using logical operators we don't use consonants we use variables because consonants values never change. Also this is not how calculations are performed. What is + 2? Where is the rest of the formula?
 
Last edited:
ooh so the only way of center it would be by making a spell? is it possible to center it in OB? so that piece of coding wouldn't have to be necessary?
 
Before effect is drawn you need to check what size it has and depending on that size calculate how much it should be moved on x's and y's.
 
Back
Top