Fortress Forever

Go Back   Fortress Forever > Editing > Mapping > Lua

Reply
 
Thread Tools Display Modes
Old 12-16-2007, 11:15 PM   #1
some-guy
 
Join Date: Dec 2007
Posts Rated Helpful 0 Times
dmg command

what is a command to put in the lua to make a trigger_ff_script do dmg to a player/ or just kill them if they touch it?
some-guy is offline   Reply With Quote


Old 12-17-2007, 01:27 AM   #2
A1win
Nutcracker
 
A1win's Avatar
 
Join Date: Sep 2007
Location: Kuopio, Finland
Posts Rated Helpful 0 Times
Send a message via MSN to A1win
I think the only way is to use a trigger_hurt. You can still add an "allowed" function for it in the lua file to check which players will take damage from it.
A1win is offline   Reply With Quote


Old 12-17-2007, 02:54 AM   #3
some-guy
 
Join Date: Dec 2007
Posts Rated Helpful 0 Times
so if i put in a trigger_hurt i can add a command in the lua so it only hurts one team any one know what that command my be?
some-guy is offline   Reply With Quote


Old 12-17-2007, 01:53 PM   #4
A1win
Nutcracker
 
A1win's Avatar
 
Join Date: Sep 2007
Location: Kuopio, Finland
Posts Rated Helpful 0 Times
Send a message via MSN to A1win
Code:
teamhurt = trigger_ff_script:new({ team = Team.kUnassigned})

redteamhurt = teamhurt:new({ team = Team.kRed})
blueteamhurt = teamhurt:new({ team = Team.kBlue})

function teamhurt:allowed( allowed_entity )
  if IsPlayer( allowed_entity ) then
    local player = CastToPlayer( allowed_entity )
    if player:GetTeamId() == self.team then
      return EVENT_ALLOWED
    end
  end
  return EVENT_DISALLOWED
end
Should work unless I made a mistake... Name the trigger_hurt as "redteamhurt" and it will hurt red team, and "blueteamhurt" will hurt blue.
A1win is offline   Reply With Quote


Old 12-17-2007, 10:45 PM   #5
some-guy
 
Join Date: Dec 2007
Posts Rated Helpful 0 Times
thanks alot man that works nice almost done with the map now woot
some-guy is offline   Reply With Quote


Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:14 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.