Search the Community
Showing results for tags 'item'.
Found 2 results
Dear all, On the 3th of July, I bought the workshop items 'Scifi materials 1' and 'Scifi materials 5'. However, when I clicked 'install', I got the following Leadwerks Editor message: "Failed to download workshop item". So, naturally I restarted the Leadwerks engine, it didn't help. So I then restarted my computer, didn't help either. Then I began looking for a solution online. I googled the error message and found various topics on this problem on these forums. Still, every single one solution didn't work out for me. These include clearing out the workshop subscribers list, deleting some leadwerks output files and finally, logging out on steam and logging back in. I have tried every possible solution that can be found online and the ones that I had on my mind. Still though, 3 days later I got the same problem. I am out of ideas. Any help whatsoever will be very much appreciated. Thanks in advance, Martijn.
So I have a weapon pick up code (from Piller's youtube video). Now I like it, think it works alright; but I want to know if there is a way to edit it for "if used" but have no clue how that would work. I am not the strongest programmer. Also would it remove the currently equipped weapon? Like "if weapon == true, drop weapon.pickup"(weapon.pick up to drop the currently carried weapon and spawn a pick up identified in the weapons code infront of the player). It may be to much to ask just seeing if it is possible. I have other programming questions but will just try this for now (as it is very important). Thanks all and here is the code that I currently have. Script.vwepfile=""--path "VWep" "Prefab (*pfb):pfb|Prefabs" --Script.vwep=nil--entity function Script:Start() if self.vwepfile~="" then local prefab = Prefab:Load(self.vwepfile) if prefab~=nil then if prefab.script~=nil then self.vwep = prefab.script else prefab:Release() end end end end function Script:Use(player) if self.vwep then if type(player.AddWeapon)=="function" then if player.weapons~=nil then if player.weapons[self.index]==nil then player:AddWeapon(self.vwep) self.entity:Hide() end end end end end function Script:Collision(entity, position, normal, speed) if self.vwep then if entity.script~=nil then self:Use(entity.script) end end end Edit# the build in pick up code works kinda but if you already have a weapon then it wont let me switch to the pick-ed up weapon. So maybe just an edit to that to fix that? Like having an inventory or something?