Ok Thanks!!
And I have this code!
I'm sorry I do not know how to code to insert
var float LastUseMeMsgTime;
var string UseMeMessage;
auto state pickup
{
function BeginState()
{
UntriggerEvent(Event, self, None);
if ( bDropped )
{
AddToNavigation();
SetTimer(20, false);
}
}
function Touch( actor Other )
{
if(!ValidTouch(Other))
{
return;
}
if(Pawn(Other) != none && PlayerController(Pawn(Other).Controller) != none && Level.TimeSeconds - LastUseMeMsgTime > 4.f)
{
LastUseMeMsgTime = Level.TimeSeconds;
PlayerController(Pawn(Other).Controller).ClientMessage(UseMeMessage, 'KFCriticalEvent');
}
}
}
function bool ValidTouch( actor Other )
{
if ( KFHumanPawn(Other) != none && !CheckCanCarry(KFHumanPawn(Other)) )
{
PlayerController(Pawn(Other).Controller).ReceiveLocalizedMessage(Class'KFMainMessages', 4);
return false;
}
return true;
}
function UsedBy( Pawn user)
{
local Inventory Copy;
local KFWeaponPickup P,Closest;
local float Dist,ClosestDist;
foreach User.TouchingActors(class 'KFWeaponPickup', P)
{
Dist = VSizeSquared(P.Location - Location);
if(ClosestDist == 0 || Dist < ClosestDist)
{
ClosestDist = Dist;
Closest = P;
}
}
if( Closest == self && ValidTouch(user) )
{
Copy = SpawnCopy(user);
AnnouncePickup(user);
SetRespawn();
if ( Copy != None )
Copy.PickupFunction(user);
TriggerEvent(Event, self, user);
}
}
defaultproperties
{
UseMeMessage="Press USE key to Pick up"
}
you have to push the button to pick up the gun
But I want it everyone can just pick up with own weapon
this is understandable?