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

Shop script works in studio, but doesnt work AT ALL In game?

Asked by
Vid_eo 126
8 years ago

This shop script I made worked PERFECTLY in studio, but not at all in game? Everything was local!

local Desc = script.Parent.Parent.Parent:WaitForChild("BBGunDesc")
local OwnedOrNot = script.Parent.Parent.Parent:WaitForChild("BBGunPriceOrOwned")
local TheImage = script.Parent.Parent.Parent:WaitForChild("BBGunImage")
local player = game.Players.LocalPlayer
local currency = player:WaitForChild('leaderstats').Money
local amount = 150
local tool = game.ServerStorage:WaitForChild("BBGun")
local indextext = "BBGun"
script.Parent.MouseButton1Down:connect(function()
    if currency.Value >= amount and not player.Backpack:FindFirstChild("BBGun") or player.Character:FindFirstChild("BBGun") then
        --They don't have it
        local newtool = tool:Clone()
        newtool.Parent = player.Backpack
        OwnedOrNot.Text = "BBGun - Owned"
    else
        script.Parent.Text = 'Purchase failed!'
        wait(1)
        script.Parent.Text = indextext
    end
end)

script.Parent.MouseEnter:connect(function()
    Desc.Visible = true
    OwnedOrNot.Visible = true
    TheImage.Visible = true
end)

script.Parent.MouseLeave:connect(function()
    Desc.Visible = false
    OwnedOrNot.Visible = false
    TheImage.Visible = false
end)


Please help! Thanks!

0
Is this a local script? BinaryResolved 215 — 8y
0
Yea Vid_eo 126 — 8y

Answer this question