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

i can not move a part from serverstorage to workspace how do i fix this?

function myfunction()

game.ServerStorage.Bullet:Clone() game.ServerStorage.Clone = game.Workspace script.Parent.fire:Play() end script.Parent.ClickDetector.MouseClick:connect(myfunction)

Edit:problem fixed.

2 answers

✓ Accepted answer

You need to put the clone under a variable in order for it to work. Here's how you do it.

local bullet= game.ServerStorage.Bullet
local bulletClone= bullet:Clone()
bulletClone.Parent= game.Workspace
--the rest of your code goes here

I hope that helped.

3 comments

0

Thanks Pokemaster8956 it worked.

0

You're always welcome.

0

the code is so much used without this code my games would be bad as rocks

you need to set the parent of the clone to the workspace therefore you will need to do it like this

local ServerStorage = game:GetService("ServerStorage")

local function myfunction()
	local bulletShot = ServerStorage.Bullet:Clone()
	bulletShot.Parent = game.Workspace
	script.Parent.fire:Play()
end)

script.Parent.ClickDetector.MouseButton1Click:Connect(myfunction)

I think this would work. If not i'm sorry i'm not extremely experienced. If it does please make this question answered

1 comment

0

im confused how that works what do i do for it to work?

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