Cloning a Tool from ReplicatedStorage into workspace

I am currently having an issue that I cannot seem to resolve alone. I am fairly new to scripting and have been learning bits and pieces. I am trying to clone my tool from ReplicatedStorage into workspace that has a prompt inside of the tool for players to interact with individually. While the script does not present any errors in the output, the interaction does not work.

Here is the script inside of Starterpack as i believe local scripts do not work is workspace:

local note = game.ReplicatedStorage.ReadNote[“Note”]:Clone()
local prox = game.ReplicatedStorage.ReadNote[“Note”].Handle[“ProximityPrompt”]:Clone()

note.Parent = workspace
prox.Parent = workspace
prox.Triggered:Connect(function(player)
note.Parent = player.Backpack
prox:Destroy()
end)

1 Like

hi :wave:

StarterPack, StarterGui, StarterPlayerScripts and StarterCharacterScript will transfer it’s containings to exact spot of the player, however, it will not let any scripts to run

to avoid this, place your script into containers, such as Workspace

If you put a Script in StarterPack and run your game you will see it print.

1 Like

You could try this:

local note = game.ReplicatedStorage.ReadNote["Note"]:Clone()
local prox = note.Handle["ProximityPrompt"]

note.Parent = workspace
prox.Triggered:Connect(function(player)
	note.Parent = player.Backpack
	prox:Destroy()
end)
1 Like

this is exactly what I was looking for:)

thank you so much. I think I just misplaced certain script lines, so it was not identifying properly. I will try to study your code to see how i can improve and why mines was faulty. I appreciate your help.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.