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

tool Shop System Thanks Who Will Fix this script and make it work normally.!?

local BT = script.Parent
local Item = game.Players.LocalPlayer.Items.Potato 
BT.MouseButton1Click:connect(function()
if game.Players.LocalPlayer.Items.Potato.Value == true then -- Gets One Player That Sees This gui right now boolvalue if true button changes text to equip
	BT.text = ("Equip")
end
	if not
		game.Players.LocalPlayer.Items.Potato.Value == false then -- Gets One Player That Sees This gui right now boolvalue  if false  button changes text to buy
		BT.text = ("Buy")
while Bt.Text = ("Buy") --if button will be clicked with mouse1 when text been is ("Buy")
BT.MouseButton1Click:connect(function() then -- its when he clicks it
	game.players.localplayer.items.potato == true -- and then him gives boolvalue true?
end)
	end
end

-- i know this script is a Bad but atleast i tried to do it? can someone make it correct? ill very apreciate it Thanks alot who will dont be lazy and help a Good person:D tool Shop System Thanks Who Will Fix this script and make it work normally.! if you can send me the code to [redacted for privacy] that peoples dont stole it.they need work too right? Thanks Alot

1 answer

There are many problems here. First, you need to learn to format your code. Second, unless you made it and didn't say that you did, there is no folder called items in the player. Learn to use else statements and else if's, it helps a lot! I noticed that you wrote something like:

bk = game.Workspace.ShopTools.Tool

then

bk = game.Workspace.ShopTools.Tool

if game.Workspace.ShopTools.Tool.Value == true then

end

Why didn't you use the variable? Also for booleans you don't need two equal signs. Also also, You make it seem like Potato is a tool, which means it doesn't have a value:

bk = game.Workspace.ShopTools.Tool

if game.Workspace.ShopTools.Tool.Value == true then

end

if not game.Workspace.ShopTools.Tool.Value == false then

end

Lastly This code:

if not game.Workspace.ShopTools.Tool.Value == false then

end

is the same as

if game.Workspace.ShopTools.Tool.Value == true then

end

this.

Format and fix the small mistakes and I'll be able to help a lot more. It might even fix the script!

14 comments

0

hey but how then i can get value that player is purchased this thing if i make if he clicks a button and then its removes his leaderstats money example -60 then changes boolvalue to true that he haves it and he can equip it also wait ill try to fix but this problem i really dont know...

0

why not just clone the tool, and give it to the player. for leaderstats, idk

0

i dont understood what you saying me right now.. one more thing i didnt writed Shop Tools Or game.Workspace? What you writing here?

0

i think you thinking about easier way..

0

yeah i want to make it easier. the game.workspace stuff is an example.

0

now listen i want to make like this so player have 100 that tool costs 50 so he clicks the button its removes his money adds v to boolvalue but when he haves boolvalue its shows text equip and when he clicks it he equips it

0

under stood?

0

Just make a function that checks if boolValue is true, and then it says equip, and takes his money away, Then, you can just make a variable called bought, and set it to true when bought. When it is bought just use if bought = true then give item

0

thats what im trying to say you dude

0

Can you fix it? im stil learning and trying to fix it now but i dont understood some things..

0

if i write. if game.Players.LocalPlayer.Items.Potato.Value = true its happens that in roblox studio its show like that https://imgur.com/a/mCSK84j can you help me?:D

0

put two ==

0

By the way, instead of trying to just jump in to making a game, take a little time to understand coding with roblox. Just a week or a month is fine. This will help you solve many basic errors.

0

By the way, instead of trying to just jump in to making a game, take a little time to understand coding with roblox. Just a week or a month is fine. This will help you solve many basic errors.

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