Jump to content

Trigger Question


havenphillip
 Share

Recommended Posts

I have this enter/exit trigger from Aggror set up to hide my weapons when I walk on the trigger and show weapons when I walk off the trigger. My problem is when I stand perfectly still on the trigger the weapons show. I don't want that so how do I stop that from happening? I tried the player script's speed, moveSpeed, and playerMovement. You can see what I'm trying to do here:

Script.enabled = true
Script.entered = false
Script.exited = false
Script.collided = false

function Script:Collision(entity, position, normal, speed)
    self.player = entity
    if self.enabled then
        self.collided = true
        if self.entered == false then
            self.entered = true
            self.exited = false
            entity.script.weapons[entity.script.currentweaponindex].entity:Hide()
            if entity:Stop() then -- right here what?
                  entity.script.weapons[entity.script.currentweaponindex].entity:Hide()
            end
        end
    end
end

function Script:UpdatePhysics()
    if self.enabled then
        if self.entered then
            if self.collided == false then
                self.exited = true
                self.entered = false
                self.player.script.weapons[self.player.script.currentweaponindex].entity:Show()
            end
        end
        self.collided = false
    end
end

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...