Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 2 years ago
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

Log in to vote
0
Answered by 2 years ago

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
0
Your suggestion would equate to "player.EquippedCharacter.Value.Value". I am guessing that is not what you meant. appxritixn 2235 — 2y
0
No, i said to get rid of the .Value at the end of the local Char. if you read you'd see that DraconianSG 58 — 2y
Ad

Answer this question