Recently I have been trying to make this oil pouring system and I cant find how to do it. I have settled on cloning a part from ServerStorage and that is very buggy, as seen from the screenshot
I have attached. Is there a way I can place the part directly onto the ground beneath the Handle of the tool?
The local script is fine, but this is the server script:
local delaying = false
local doing = false
local player
local gui
local tool = script.Parent
function spilloil()
local oilspill = game.ServerStorage.oil:Clone()
oilspill.Parent = game.Workspace
oilspill.Position = script.Parent.Handle.Position
script.Parent.GasLeft.Value = script.Parent.GasLeft.Value - 1
wait(1)
oilspill.Anchored = true
end
script.Parent.Handle.mousehandler.OnServerEvent:Connect(function()
if script.Parent.GasLeft.Value == 0 then
gui:Destroy()
tool:Destroy()
end
if delaying == false then
delaying = true
wait(0.04)
delaying = false
spilloil()
end
end)
Help would be appreciated.