Mapledev Posted Monday at 12:52 PM Share Posted Monday at 12:52 PM 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 Monday at 04:31 PM Share Posted Monday at 04:31 PM 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 Monday at 04:37 PM Author Share Posted Monday at 04:37 PM 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 Monday at 05:16 PM Solution Share Posted Monday at 05:16 PM 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 Monday at 06:10 PM Author Share Posted Monday at 06:10 PM (edited) Thanks josh ur the best. oh lol sorry im stupid i meant in leadwerks 4.6 sorry. Edited Monday at 06:15 PM by Mapledev misunderstanding Quote Link to comment Share on other sites More sharing options...
Josh Posted Monday at 06:23 PM Share Posted Monday at 06:23 PM 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.