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

Script to give tools based on character value, Why won't this work?

game.Players.PlayerAdded:Connect(function(Player)
		    Player.CharacterAdded:Connect(function(Character)
			        local player = script.Parent
			        local Char = player.EquippedCharacter.Value
			        local Tool = script.Blaster
			 
			        if Char == "Lucas" then
				            local ToolClone = Tool:Clone()
				            ToolClone.Parent = Player.Backpack
				        end
			    end)
		end)

There is a value stored under the player called EquippedCharacter than it changed based on what character is selected in the shop, in this case Lucas. It is similar to how a leadstat is stored I guess. I want this script to give you tools if you have Lucas selected but it wont work? Could I get some help?

1 answer

I don't know why but this normally works for me, get rid of the .Value in the local Char and make it so that instead of

if Char == "Lucas then

its

if Char.Value == "Lucas then

2 comments

0

Your suggestion would equate to "player.EquippedCharacter.Value.Value". I am guessing that is not what you meant.

0

No, i said to get rid of the .Value at the end of the local Char. if you read you'd see that

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