etc; props, cps, an ordnance like a mine, maybe other things like destructible props.
Anything?
Moderator: Moderators





Code: Select all
object = [whatever object you want to have around player]
human = nil -- for now just assume only 1 human, this is a SP game
update = CreateTimer("update")
SetTimerValue(update,0.2) -- updates every .2 seconds, adjust as you want
OnTimerElapse(function(timer)
if human and GetCharacterUnit(human) and IsObjectAlive(GetCharacterUnit(human)) then -- human is alive, move object and restart timer
SetEntityMatrix(object, CreateMatrix(0,0,0,0,0,0,1,GetEntityMatrix(GetCharacterUnit(human)))) -- adjust the 1 based on how much in front/behind
SetTimerValue(update,0.2) -- updates every .2 seconds, adjust as you want
StartTimer(update)
end
end,
update)
OnCharacterSpawn(function(player)
if IsCharacterHuman(player) then
human = player
SetEntityMatrix(object, CreateMatrix(0,0,0,0,0,0,1,GetEntityMatrix(GetCharacterUnit(human)))) -- adjust the 1 based on how much in front/behind
StartTimer(update)
end
end)





