Im currently working on a naruto game, where you can spin to choose your clan, etc. When the player clicks the button, the 'Clan' value, is turned into the randomly chosen clan. Right now what im trying to do, is find a way to change the imagelabel's image to a logo of the clan. For some reason, this error keeps popping up:
LocalScript:19: attempt to index 'Image'(a string value)
Heres the code;
Clans = {'Uchiha', 'Uzumaki', 'Senju', 'Otsutsuki'}
local player = game.Players.LocalPlayer
local tag = player:WaitForChild'Clan'
local spins = player:WaitForChild'Spins'
script.Parent.MouseButton1Click:connect(function()
if spins.Value >= 1 then
spins.Value = spins.Value - 1
local chosen = math.random(1,4)
chosenf = Clans[chosen]
tag.Value = ''..chosenf
script.Parent.Text = tag.Value
if script.Parent.Text == 'Uchiha' then
script.Parent.Parent.ImageLabel.Image.Image = 'rbxassetid://924320031'
elseif script.Parent.Text == 'Otsutsuki' then
script.Parent.Parent.ImageLabel.Image.Image = 'rbxassetid://344062616'
end
else
script.Parent.Text = 'Not enough Spins!'
wait(2)
script.Parent.Text = chosenf
end
wait(2)
end)
Is there any better way to go about this ? Maybe coroutine, or something i can use to fix this error?
