@Turtle sorry for having been so brief in the explanations . Here's a piece of code that shows you better what I mean. You can decide if the light must stop before reaching the player coords. Just let me know if that is ok for you.
Cheers.
autocam off
sync on
ink rgb(0,100,0)
box 0,0,10,10
get image 1,0,0,10,10
`floor
make matrix 1,100,100,40,40
prepare matrix texture 1,1,1,1
`player
make object box 1,3,5,1
position object 1,10,2,10
`light helper ( the sphere) just to place the light on
make object sphere 2,1,18,18
position object 2,0,10,0
set object light 2,0
`Ambient Setup
set ambient light 10
hide light 0
make light 1
position camera -30,30,-30
point camera 0,0,0
do
`player movements
if upkey() then move object 1,0.05
if downkey() then move object 1,-0.05
if leftkey() then rt#=rt#-0.5
if rightkey() then rt#=rt#+0.5
yrotate object 1,rt#
`folowing the player
point object 2,object position x(1),object position y(2),object position z(1)
position light 1,object position x(2),object position y(2) , object position z(2)
move object 2,0.02 `this value must be less then player moving
sync
loop
I'm not a grumpy grandpa
