What do you want to achieve?
I want to understand this script.
What is the issue?
I don’t understand this script:
RunService = game:GetService(“RunService”)
local t = 0
RunService.Heartbeat:Connect(function(step)
t += step
if t >= rateOfPowerDecreasing then
power -= 1 + (objectsActivated*0.2)
t = 0
end
end)
What solutions have you tried so far?
Now, as this is a script, it isn’t really searchable.
What part of the script don’t you understand? and what part of it do you want to understand? You need to be more specific about your problem. (Also use the ``` formatting for scripts)
What do you mean by variable? Is objectsActivated an IntValue that is set to a variable? I still don’t understand what you mean by making the objectsActivated variable “go up”
You would need an IntValue and a ClickDetector. For example…
local cd = script.Parent.ClickDetector
local objectsActivated = script.Parent.IntValue
cd.MouseClick:Connect(function()
objectsActivated.Value = objectsActivated.Value + 1
print(objectsActivated.Value.." Object(s) have been activated")
end)
This is also how you would want to place the items into workspace: