Grabbing a variable of a sphere [Lua]

Status
Not open for further replies.

amperbee

thunderdome denizen
I have a code that, when a certain command is used, a sphere spawns above the player, the which contains some variables (i.e a variable like mobj.effect) that I'd like to grab when a player collects that sphere.
I mean, if the sphere has the variable effect set to 5 and a player grabs this sphere, the variable is passed to another and a code is run for that player to do something.

What do I have to do?
 
You need to localize the spawned object, like so:

Code:
local sphere = P_SpawnMobj(player.mo.x, player.mo.y, player.mo.z, MT_SPHERE)
sphere.effect = 5
 
Status
Not open for further replies.

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top