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

Replacement item spawns Next to original?

Asked by 2 years ago

I am making a game where you have to rob things so i have a full register and an empty on in replicated storage, for some reason when you claim the full one the empty one spawns where i originally made it. here is the script.

local prompt = script.Parent

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local EmptyReg = ReplicatedStorage:FindFirstChild("Empty")

prompt.Triggered:Connect(function(player)
    player.leaderstats.Money.Value += 86

    local Empty = EmptyReg:Clone()
    Empty.Parent = game.Workspace
    Empty["Origin Position"] = UDim2.new(script.Parent.Parent.x, 0, script.Parent.Parent.y, 0)

    script.Parent.Parent:Destroy()

end)

Answer this question