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

How do I convert this tycoon button script to use ServerStorage?

Asked by
RoyMer 301 Moderation Voter
10 years ago

I need to try make this to load the tycoon parts from the ServerStorage instead of cloning them, but I don't really have an idea what to do, if anyone could guide me maybe, much appreciated.

-------------------------------------------------------------------------------------------------------------------------
model = script.Parent.Parent.Parent.ITEMNAMEHERE -- Put Item Name There,Do Not Touch Other Stuff Below The Cost Price.
Upgradecost = 0   -- Item Price
-------------------------------------------------------------------------------------------------------------------------
upgradeStuff = model:clone()

wait(1)

model:remove() 
owner = script.Parent.Parent.Parent.OwnerName
local ting = 0

function onTouched(hit) 
    if ting == 0 then 
    ting = 1 
    check = hit.Parent:FindFirstChild("Humanoid") 

    if check ~= nil then
    if hit.Parent.Name == owner.Value then 
        local user = game.Players:GetPlayerFromCharacter(hit.Parent) 
        local stats = user:findFirstChild("leaderstats") 

        if stats ~= nil then 
            local cash = stats:findFirstChild("Cash") 
            if cash.Value > (Upgradecost-1) then 

                cash.Value = cash.Value - Upgradecost 
                upgradeStuff.Parent = script.Parent.Parent.Parent
                script.Parent.Parent:remove() 

            end 
        end 
    end 
    end 

    ting = 0 
    end 
end 

script.Parent.Touched:connect(onTouched) 
0
Change first line to | game.ServerStorage.model | "model" is the tycoon part being moved. If you don't want cloning remove the ":clone()" on line 5 ultimate055 150 — 10y
0
thanks it worked :) RoyMer 301 — 10y

1 answer

Log in to vote
-1
Answered by 10 years ago

Honestly if I were you I'd leave it as is.

Ad

Answer this question