Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

please help with this script wont enable the local script ?

local player = script.Parent.Parent.Parent.Parent.Parent
local level = player.leaderstats.Lvl
local price = 0

function buy()
	if level.Value >= price then
		game.StarterPack.SS1.Disabled = false
	end
end

script.Parent.MouseButton1Down:connect(buy)

######Format your code correctly

2 comments

0

works in studio not in game

0

Rather than messing with the Disabled property, you should edit the SS1 code or tool to have the level prerequisite.

1 answer

###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)

2 comments

0

thx

0

Mark it as answer.

This discussion is preserved as it was. New answers, comments, and votes are closed.