Answered by
6 years ago Edited 6 years ago
First off, what is script.Parent.Parent.Parent.Parent.Parent
? Why are you getting the player like this? You should use Players.LocalPlayer
.
The problem with the script was that you tried to enable a script from StarterPack
. Anything that goes in the StarterPack
, StarterGui
, StarterPlayerScripts
, or StarterCharacterScripts
get cloned to the Backpack
, PlayerGui
, PlayerScripts
, and the player's Character
. In this case, your script is in the Backpack
. You'd instead look for the script inside the Backpack
.
wait()
local player = game:GetService('Players').LocalPlayer
local level = player.leaderstats.Lvl
local price = 0
local function buy(inputObject)
if level.Value >= price then
player.Backpack.SS1.Disabled = false
end
end
script.Parent.Activated:Connect(buy)