Failed miserably, since i haven´t really defined anything for now. Here are the versions of the plates i want as objects.
Version 1: Instant Break
local trapplate = self.go:spawn("urban_town_wooden_floortrigger")
trapplate.floortrigger:addConnector("onActivate", self.go.id, "Trap")
trapplate.floortrigger:setDisableSelf(true)
function Trap(plate)
---[[ particle effects:
plate.go:createComponent("Particle")
plate.go.particle:setParticleSystem("hit_wood")
plate.go.particle:setDestroySelf(true)
plate.go.particle:fadeOut(.7)
--]]
party.party:shakeCamera(.5,.5)
playSound("barrel_die")
delayedCall(self.go.id, .7, "erasePlate", plate.go.id)
end
end
makeplate()
function erasePlate(plateId)
findEntity(plateId):destroy()
end
local trapplate = self.go:spawn("urban_town_wooden_floortrigger")
trapplate.floortrigger:addConnector("onActivate", self.go.id, "Trap")
trapplate.floortrigger:setDisableSelf(true)
function Trap(plate)
---[[ particle effects:
plate.go:createComponent("Particle")
plate.go.particle:setParticleSystem("hit_wood")
plate.go.particle:setDestroySelf(true)
plate.go.particle:fadeOut(.7)
--]]
playSound("barrel_hit")
delayedCall(self.go.id, 1, "next", plate.go.id)
function next(plate)
---[[ particle effects:
local plate = findEntity(plate)
plate:createComponent("Particle")
plate.particle:setParticleSystem("hit_wood")
plate.particle:setDestroySelf(true)
plate.particle:fadeOut(.7)
--]]
party.party:shakeCamera(.5,.5)
playSound("barrel_die")
delayedCall(self.go.id, .7, "erasePlate", plate.id)
end
end
end
makeplate()
function erasePlate(plateId)
findEntity(plateId):destroy()
end
name = "urban_town_wooden_floortrigger_instant",
baseObject = "floor_trigger",
components = {
{
class = "Model",
model = "mod_assets/sx_urban_town/models/sx_house01_wooden_ceiling.fbx",
},
{
class = "Platform",
},
{
class = "FloorTrigger",
self.go.floortrigger:setDisableSelf(true),
onActivate = function(self)
self.go:createComponent("Particle")
self.go.particle:setParticleSystem("hit_wood")
self.go.particle:setDestroySelf(true)
self.go.particle:fadeOut(.7)
party.party:shakeCamera(.5,.5)
playSound("barrel_die")
delayedCall(self.go.id, .7, "erasePlate", self.go.id)
end,
erasePlate = function(plateId)
findEntity(plateId):destroy()
end,
},
},
placement = "floor",
editorIcon = 184,
}
It is nothing more than a platform with wooden texture combined with a floortrigger.
I welcome any help for my Problem.