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

How would I put a model into the character when they equip the tool?

So, I have a script in a tool that basically fires when the tool is equipped. That part works. Then its meant to clone a model and put it into the character. This worked up until a while ago (maybe there was an update to FE?).

local tool = script.Parent 
	print('equipped')
tool.Equipped:connect(function()
	local player = tool.Parent.Parent
	
	local motor = script.SniperHandle:Clone()	
	local model = game.ServerStorage.tool:Clone() --doesn't work? how do I get this tool?
	
	local c = script.Parent.Parent
	print('model',c)
	
--Welding script here (works)

I've tried cloning it from Workspace and from a folder in the character, but nothing seems to be working. I'm starting to wonder whether clone() still works.

How would I get to the model? (This script is in a tool)

1 answer

✓ Accepted answer

Hey! I'm BlackOrange and I will be helping you.

The problems seems like the Script is a LocalScript. One thing you have to know is that the Client AKA the LocalScript can NOT access the ServerStorage. What I do suggest you do is place the tool inside the ReplicatedStorage.

Here:

local tool = script.Parent 
print('equipped')

tool.Equipped:Connect(function() -- use Connect over connect
    local player = tool.Parent.Parent

    local motor = script.SniperHandle:Clone()   
    local model = game.ReplicatedStorage.tool:Clone() --Place tool in ReplicatedStorage

    local c = script.Parent.Parent
    print('model',c)

--Welding script here (works)

and if like you said everything works then it should work.

Best of luck developer!

Hoped this helped.

1 comment

0

I had thought about this and if no one responded I was about to ask about the efficiency of storing items in Replicated storage.

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