I am trying to fire a function when the player clicks and a Boolean is true but it does nothing.
m.Button1Down:Connect(function()
if script.Parent.Active == true then
print("clicked w/ active")
heal()
end
end)
I am trying to fire a function when the player clicks and a Boolean is true but it does nothing.
m.Button1Down:Connect(function()
if script.Parent.Active == true then
print("clicked w/ active")
heal()
end
end)
local m = plr:GetMouse()
Is what m stands for.
BoolValue.Value
Is what you should be going for.
Is Active
a property that’s true/false? Or is it an object?
active is the name of the boolean
I assume you mean BoolValue (roblox.com) : p
In that case, you’ll want to compare it’s BoolValue.Value (roblox.com) property instead.
if script.Parent.Active.Value == true then
heal()
end
It says attempt to index boolean with value
What is the script.Parent
? Like, is it a Tool
or something that the script’s within?
The script is in a frame of a Gui
I figured it out
If a boolValue is in a frame then you have to say
if script.Parent:WaitForChild(“Active”).Value == true then
heal()
end
You see when you click it checks if it is true. Is it true by default or does something trigger a script to make it true? Because sometimes it won’t work till u also make that script.