How do i make a script give tools based on a Value in Player?
hello im trying to make a Devil Fruit System where if u eat a fruit player:LoadCharacter() gets fired then a value in your player gets changed. And all im trying to do is to make a script where every time you respawn it detects the value then it gives weapons based on the value.
heres what i tried to do.
01 | game.Players.PlayerAdded:Connect( function (player) |
02 | if not player:WaitForChild 'Data Folder' then return end |
03 | if player:WaitForChild 'Data Folder' .Fruit.Value = = "" then |
04 | player:WaitForChild 'Data Folder' .Fruit.Value = "None" |
06 | if player:WaitForChild 'Data Folder' .Fruit.Value = = "Devil Fruit" then |
07 | for _,v in pairs (game.Lighting.Skills.DevilFruit:GetChildren()) do |
08 | local copies = v:Clone() |
09 | copies.Parent = player.Backpack |