Mapledev Posted November 18, 2024 Posted November 18, 2024 PickUpItem - FadeScreen.luacan someone help me with this? how do i change the FPSPlayer's moveSpeed variable from an another script. Quote
Josh Posted November 18, 2024 Posted November 18, 2024 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.
Mapledev Posted November 18, 2024 Author Posted November 18, 2024 Thanks but after getting the component how can i modify that value? as coding. Quote
Solution Josh Posted November 18, 2024 Solution Posted November 18, 2024 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.
Mapledev Posted November 18, 2024 Author Posted November 18, 2024 (edited) Thanks josh ur the best. oh lol sorry im stupid i meant in leadwerks 4.6 sorry. Edited November 18, 2024 by Mapledev misunderstanding Quote
Josh Posted November 18, 2024 Posted November 18, 2024 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.
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.