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

How to make a code system that gives a flashlight?

if script.Parent.Parent.CodeBar.Text == "BETATESTER" then script.Parent.MouseButton1Click:Connect(function() script.Parent.Text = "Succesfully Redeemed!" wait(2) script.Parent.Text = "Redeem"

		player.Backpack == "Flashlight"
	end

end

is my script and it wont work if its really off its because im new to scripting

1 answer

You can't set the backpack to "Flashlight"

You have to put a flashlight tool inside backpack.

Other than that, here's a fixed script:

script.Parent.MouseButton1Click:Connect(function()
	if script.Parent.Parent.CodeBar.Text == "BETATESTER" then

		-- put code here to give the player a flashlight since I don't know what the flashlight is called and where it is

		--and leave this part below alone
		script.Parent.Text = "Succesfully Redeemed!"
		wait(2)
		script.Parent.Text = "Redeem"
	end
end)

If you need to figure out how to copy a flashlight from somewhere into the backpack without it disappearing from the first place, you might want to look up the cloning feature.

6 comments

0

scrioting is to hard

0

please accept if this worked/helped

0

for some reason it didnt work

0

cause you have to give the player the flashlight yourself by editing the script. did you read the green text i set?

0

why can't i? cause i got no information on the flashlight

0

the clone system is hard to understand

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