Mapledev Posted November 18 Share Posted November 18 PickUpItem - FadeScreen.luacan someone help me with this? how do i change the FPSPlayer's moveSpeed variable from an another script. Quote Link to comment Share on other sites More sharing options...
Josh Posted November 18 Share Posted November 18 Get the FPSPlayer component from the entity: https://www.ultraengine.com/learn/Entity_GetComponent?lang=lua Then you can modify that component's values. 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...
Mapledev Posted November 18 Author Share Posted November 18 Thanks but after getting the component how can i modify that value? as coding. Quote Link to comment Share on other sites More sharing options...
Solution Josh Posted November 18 Solution Share Posted November 18 component = entity:GetComponent("FPSPlayer") if component ~= nil then component.value = 1 end 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...
Mapledev Posted November 18 Author Share Posted November 18 (edited) Thanks josh ur the best. oh lol sorry im stupid i meant in leadwerks 4.6 sorry. Edited November 18 by Mapledev misunderstanding Quote Link to comment Share on other sites More sharing options...
Josh Posted November 18 Share Posted November 18 In Leadwerks the component is located at entity.script. Here is an example: function Script:FindUsableEntity(entity) while entity~=nil do if entity.script then if type(entity.script.Use)=="function" then --If "enable" has not been set, it still won't be "false" so this will pass: if entity.script.enabled~=false then return entity else return nil end end end entity = entity:GetParent() end return nil end 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...
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.