- What do you want to achieve? Keep it simple and clear!
When a player joins the game they get 5 different attacks they can pick from (The script here only includes the 1st attack, the others are the same), i want to keep the info on the player so that the button can display what attack it is and how much damage it does and stuff. I tested it out and it does not give any error, if I add .Value to it does.
-
What is the issue? Include screenshots / videos if possible!
The script does not work and does not output any errors, I added .Value to the end and then it did
The script below is the one that produces no error
game.Players.PlayerAdded:Connect(function(plr)
local board = plr.PlayerGui:WaitForChild("board")
local one = board.Frame.ImageLabel:FindFirstChild("1")
local two = board.Frame.ImageLabel:FindFirstChild("2")
local three = board.Frame.ImageLabel:FindFirstChild("3")
local four = board.Frame.ImageLabel:FindFirstChild("4")
local five = board.Frame.ImageLabel:FindFirstChild("5")
---------------------------------------------------------------
local num1 = math.random(1,10)
local da = one:WaitForChild("da")
local crd = one:WaitForChild("crd")
local typ = one:WaitForChild("typ")
if num1 == 1 then
da = 10
crd = "placeholder"
typ = "attack"
elseif num1 == 2 then
da = 15
crd = "placeholder"
typ = "attack"
elseif num1 == 3 then
da = 20
crd = "placeholder"
typ = "attack"
elseif num1 == 4 then
da = 10
crd = "placeholder"
typ = "attack"
elseif num1 == 5 then
da = 10
crd = "placeholder"
typ = "attack"
elseif num1 == 6 then
da = 15
crd = "placeholder"
typ = "attack"
elseif num1 == 7 then
da = 15
crd = "placeholder"
typ = "attack"
elseif num1 == 8 then
da = 20
crd = "placeholder"
typ = "attack"
elseif num1 == 9 then
da = 15
crd = "placeholder"
typ = "attack"
elseif num1 == 10 then
da = 40
crd = "placeholder"
typ = "attack"
end
end)
``