Why do i keep experiencing bugs?

Tools behavior, my favorite bug.

This is the script:

local tool = script["Parent"]

tool["Parent"] = game:GetService("StarterPack")

function WhenEquipped()
	local Part = Instance.new("Part")
	Part["Parent"] = game["Workspace"]
	wait(3)
	Part:Destroy()
end

function WhenUnEquipped()
	game["Workspace"]["SpawnLocation"].Anchored = true
	game["Workspace"]["SpawnLocation"].Position = Vector3.new(0, 9.5, 0)
end

function UnAnchor() 
	game["Workspace"]["SpawnLocation"].Anchored = false
end

tool["Activated"]:Connect(UnAnchor)
tool["Equipped"]:Connect(WhenEquipped)
tool["Unequipped"]:Connect(WhenUnEquipped)

When i equip the tool, i get stuck on the floor.

Honestly the 2021 version of roblox was much better, better menu, roblox studio looked so much better, i just miss that version so much.

Each part of the tool must be anchored = false.
EDIT: I suggest you use dot (.) not [""] ] because it is more stable.
e.g: tool.Activated:Connect(UnAnchor).
If your text is separated, use [""], if not, use a dot

For the “I equip the tool I get stuck”, is every part in your Tool unanchored? That’d be the only thing likely pinning you to the floor. Now as far as your code, it raises some… questions… Please feel free to answer so we can better help you:

It’s very interesting to access a part’s properties, you’re using brackets instead of directly tool.Parent. Why is that?

Is this a local or a server script?

In the script, why are you parenting it to StarterPack? If anything put it there by default?

What is your use case with anchoring/unanchoring a spawnLocation? Assuming it’s allowed to freefall, you may want to considering altering its CFrame instead of just its Position to account for its orientation.

1 Like

I first put this in the #bulletin-board until someone took it down and then it got reopened and moved to scripting support, it was even edited.

Anyways, yes its a server script bc i am not a big fan of local scripts…

Edit: I like setting the properties and parenting the tool with script rather than just doing it, i like better that way.

And i feel like using square brackets to access things.

I do not know about the fourth question.