Script doesn't find model in a tool

Hi, I want that a value in a local script finds a model.
The local script is in a tool and the model too.
I tried some things but it didn’t helped me.
Here the code:

bin = script.Parent
function onButton1Down(mouse)
	local model = script.Parent.PoliceBarrierPlace:clone() -- Here is the error
	model.Parent = game.Workspace
	local Parts = model:GetChildren()
	Parts.CanCollide = true
	Parts.Anchored = false
	Parts.Transparency = 0
	model.Part.SurfaceGui1.Enabled = true
	model.Part.SurfaceGui2.Enabled = true
	model.CFrame = bin.PoliceBarrier.CFrame
	wait(2)
end

function onEquipped(mouse)
	if mouse == nil then
		return 
	end
	mouse.Button1Down:Connect(function()
		onButton1Down(mouse)
	end)
end

script.Parent.Equipped:Connect(onEquipped)

Here are some pictures:
image (The script is inside Spawner)
image (The game output)
Does anyone know why this is not working?

The model name is spelled incorrectly. You have it as ‘PoliceBarriePlace’.

Also since all of this is done from a local script it’s not going to replicate, meaning the barrier will be invisible to anyone else in the game.

1 Like

Ok, thanks. But I fixed the spelled word, but it is saying still the same problem.
I found out, if I have the tool in Backpack, the model disappears.

Maybe clone the model from ReplicatedStorage instead of keeping it inside the tool?

1 Like

Ok, I try to do that. Thanks for your help and sorry for my stupid spelling error. :happy3:
[EDIT] I found out my key"R" is broken, that is why it did not wrote!