Hi.
I'm only getting started with scripting in GameGuru but I have faced a problem right at the beginning.
I figured I start with a very simple script that display a message on the screen if the player is for certain distance from an entity and also hide the entity. But I can't get it to work.
This is my code:
function myscript_init(e)
Prompt("Initialized")
end
function myscript_main(e)
playerDist = GetPlayerDistance(e)
if playerDist < 1000 then
Prompt("Entity is hidden")
Hide(e)
end
end
It doesn't work and I have no idea why. I don't get the text on the screen not even the Initialized one and the entity never get hidden.
I don't have much experience with Lua but I do have some experience with other languages but have no idea why is this not working.
I have the script inside the scriptbank folder, I have attached the script to the entity, the entity is in the scene not sure what else I need to do.
I also tried the example script from the Steam Guide and that doesn't work neither.
Could anyone give me a kick in the right direction please?
Thanks.