HELP! I created a increase and decrease system. I Added a sanity system for my game on numer values instances, on a prompt i tried to make the sanity decreases but the script cannot find the instance.
PROMPT SCRIPT
local prompt = script.Parent
local module = require(game:GetService("ServerScriptService")["D.A.S"])
prompt.Triggered:Connect(function(plr)
local humanoid = plr.Character:WaitForChild("Humanoid")
local attribute = humanoid.Health
module.Decrease(10,humanoid:WaitForChild("Sanity").Value)
end)
MODULE SCRIPT (DECREASE AND INCREASE SYSTEM)
local Increase = {}
function Increase.Increase(Value: number, Attribute)
Attribute = Attribute + Value
print("Increased "..Attribute)
end
function Increase.Decrease(Value: number,Attribute)
Attribute = Attribute - Value
print("Decreased "..Attribute)
end
return Increase
Can you guys give me a feedback? 