Jump to content
mstnothing_else

Script to open a door using a floor switch?

Recommended Posts

Hey everyone, i'm really new at this so please be understanding. I'm trying to write a Script to open a Door with a floorswitch. The idea is  to drop a box and activate the switch. I'm using the prefab boxes and the SlidingDoor.Lua.  I saw this video below but the problem is that the script works only if you put the value name in the Script

function Script:Collision (entity, position, normal, speed)
    if (entity: GetKeyValue ("name") == "crate_small") then
        self.component: CallOutputs ("Open")
    end
    
end

but what i want is to be able to assign or to change the object-door-opener from the Script tab, by creating a Script Entry, I just don't know how cause i'm really new at this. Thanks for your help.

 

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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.

×
×
  • Create New...