Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

I need this script to work but it wont and nothing happens to the value, whats wrong?

local tool = script.Parent

tool.Equipped:connect(function()
	print("Worked")
	local instance = Instance.new("BoolValue")
	instance.Parent = game.StarterPack.Fireball
	wait(1)
	game.StarterPack.Fireball.Value.Value = true
	local value = game.StarterPack.Fireball.Value
	if value.value == true then
		print("activated")
	end
	
end)

localscript inside the tool by the way

1 answer

You need to change the value inside the backpack of the player, not in starterpack.

local tool = script.Parent

tool.Equipped:connect(function()
    print("Worked")
    local instance = Instance.new("BoolValue")
    instance.Parent = game.Players.LocalPlayer.Backpack.Fireball
    wait(1)
    game.Players.LocalPlayer.Backpack.Fireball.Value.Value = true
    local value = game.Players.LocalPlayer.Fireball.Value
    if value.value == true then
        print("activated")
    end
end)

Feel free to accept this answer if this helped you.

This discussion is preserved as it was. New answers, comments, and votes are closed.