So this script i made reads a bool value that is set true by another local script. whats odd is that whenever this bool value is true in the output theres an error either:
aiming isnt a valid member of tool
script cannot find firstpersonarms
This means whenever the script is applied it wont change the Y value which is a huge problem
local Player = game.Players.LocalPlayer
local AIMING = script.Parent.Aiming
if AIMING.Value == true then
Player.PlayerGui["FirstPersonArms"].LERP.Y.Value = -1.2
else
Player.PlayerGui["FirstPersonArms"].LERP.Y.Value = -1
end
From the code you have given, that script will only run once. If you want it to detect whenever the bool value has changed and check if AIMING.Value = true then you should put it inside a while true do statement or put it inside a function that is triggered using GetPropertyChangedSignal or Changed
(This may or may not be useless because I am slightly confused at what you need help with)
local Player = game.Players.LocalPlayer
local AIMING = script.Parent:WaitForChild("Aiming")
AIMING.Changed:Connect(function()
if AIMING.Value == true then
Player.PlayerGui:WaitForChild("FirstPersonArms").LERP.Y.Value = -1.2
else
Player.PlayerGui:WaitForChild("FirstPersonArms").LERP.Y.Value = -1
end
end)
This script is suppose to check if a bool value is set true via another script activating this bool value and if it isnt the LERP is suppose to go back to -1
Whats weird is that if i add something stupid like this
local Player = game.Players.LocalPlayer
local AIMING = script.Parent.Aiming
script.Enabled = false
wait()
script.Enabled = true
if AIMING.Value == true then
Player.PlayerGui["FirstPersonArms(R6)"].LERP.Y.Value = -1.2
else
Player.PlayerGui["FirstPersonArms(R6)"].LERP.Y.Value = -1
end
it starts working
i took turning it off then turning it back on literally and it works idk how but it seems super unreliable