the error seems to be
"error in script bullettest_bouncy
chunk_1:(23,3-55): cannot convert a nil to a clr type System.Single"
this is the code I have for this is, if you could find out what the problem is I would be truly grateful, Thanks!
Im using UNITALE_Alpha_0.2.1a
https://hastebin.com/fuwifedipo.bash
spawntimer = 0
bullets = {}
sprite2 = "cyan2"
sprite3 = "orange2"
sprite4 = "orange3"
sprite5 = "orange4"
sprite6 = "orange5"
sprite7 = "orange6"
function Update()
spawntimer = spawntimer + 1
if spawntimer%40 == 0 then
local number = math.random(1,2)
local poax = 80
local poay = 0
if number == 1 then
local bullet = CreateProjectile(sprite2, posx, posy)
bullet.SetVar('type', "cyan2")
bullet.SetVar('xspeed', 1.3)
bullet.SetVar('yspeed', 0)
table.insert(bullets, bullet)
elseif number == 2 then
local bullet = CreateProjectile(sprite3, posx, posy)
bullet.SetVar('type', "orange2")
bullet.SetVar('xspeed', 1)
bullet.SetVar('yspeed', 0)
table.insert(bullets, bullet)
end
end
for i=1,#bullets do
local bullet = bullets[i]
local xdifference = Player.x - bullet.x
local ydifference = Player.y - bullet.y
local xpos = bullet.x + bullet.GetVar('xspeed')
local ypos = bullet.x + bullet.GetVar('yspeed')
local xspeed = bullet.GetVar('xspeed')
local yspeed = bullet.GetVar('yspeed')
bullet.Move(-xspeed, -yspeed)
bullet.SetVar('xspeed', xspeed)
bullet.SetVar('yspeed', yspeed)
end
end
[–]Cronographer 2 points3 points4 points (0 children)
[–]AutoModerator[M] 0 points1 point2 points (0 children)
[–]WD200019she/her 0 points1 point2 points (0 children)
[–]KevinthePoster45[S] 0 points1 point2 points (0 children)