Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 4 years ago
Edited 4 years ago

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

Log in to vote
0
Answered by 4 years ago

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.

0
Thanks Pokemaster8956 it worked. MadnessMyth 10 — 4y
0
You're always welcome. Cyroxite 46 — 4y
0
the code is so much used without this code my games would be bad as rocks MadnessMyth 10 — 4y
Ad
Log in to vote
0
Answered by 4 years ago

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

0
im confused how that works what do i do for it to work? MadnessMyth 10 — 4y

Answer this question