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.
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.
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.
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
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.
3 comments
Thanks Pokemaster8956 it worked.
You're always welcome.
the code is so much used without this code my games would be bad as rocks