I have a tool that is supposed to give the player stats when activated, however there are no errors and it doesn't seem to be working. The problem I see is at
script.Parent.Activated:Connect(function()
because nothing is printed after that line of code. Any help would be appreciated!
By the way, I've tried this with both filtering enabled on and off, and with a local script and a normal script. All it contains is just a tool in starterpack with a script as the tool's child.
local player = script.Parent.Parent.Parent
print("line 2")
db = false
print("line 4")
script.Parent.Activated:Connect(function()
if db == false then
print("line 6")
db = true
local randomm = math.random(1,2)
print(1)
if randomm == 1 then
print("1")
player.Stats.Strength.Value = player.Stats.Strength.Value + 1
end
if randomm == 2 then
print("2")
player.Stats.Strength.Value = player.Stats.Strength.Value + 2
end
end
wait(1)
print("db = false")
db = false
end)

3 comments
Not exactly related to the answer you want but something to clear up thats irking me a bit. Why not make it so that the value added (1 or 2) is the "randomm" variable instead, you can easily remove 6 lines of code from your current script by doing that. I did think that maybe you have something in mind with those "randomm" if statements but im just making sure with you, that is all
Once I get it working I'm going to add more random statements with animations for each one.
It's bothering me how "randomm" is spelled wrong.