drarem Posted August 26, 2015 Share Posted August 26, 2015 I have a strange error. I'm using this below. It happens with any gun. When I click a 'start' button to begin, the code is executed below, but the rifle doesn't appear and i can only get one shot off until I go to an object where the hand icon hovers over it, like a pick call. Then the gun appears and i can shoot. Does anyone have any ideas? Thanks. Mapfile contains the player prefab, pointing to the fpsplayer.lua script. In the FPSPlayer.lua code: if self.weaponfile~="" then local prefab = Prefab:Load(self.weaponfile) if prefab~=nil then if prefab.script~=nil then self:AddWeapon(prefab.script) else prefab:Release() end-- end end Quote Link to comment Share on other sites More sharing options...
drarem Posted August 26, 2015 Author Share Posted August 26, 2015 Changed it to this at the end of the Start() function in FPSPlayer.lua. When I point my crosshair at an object to pick up, the gun pops up. I wonder if this is in the picking? if self.weaponfile~="" then self.fgun = Prefab:Load(self.weaponfile) if self.fgun~=nil then if self.fgun.script~=nil then self:AddWeapon(self.fgun.script) System:Print("weapon should be added here, but it isn't") else self.fgun:Release() end-- end end Quote Link to comment Share on other sites More sharing options...
Josh Posted August 27, 2015 Share Posted August 27, 2015 I was hoping I would have time to help you with this today, but I am going out of town in the morning. Will be able to take a closer look next week. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
drarem Posted September 1, 2015 Author Share Posted September 1, 2015 Welcome back, any updates? Thnx Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.