What is wrong with my script and how can I fix it? Here is my script below
local button = script.Parent
local player = game.Players.LocalPlayer
local tweenservice = game:GetService("TweenService")
local ws = game:GetService("Workspace")
local screens = ws:WaitForChild("Screens")
button.MouseButton1Click:Connect(function()
local stuff = screens:GetDescendants()
for i,v in pairs(stuff) do
if v:IsA("StringValue") and v.Value == player.Name then
v.Parent.Visible = false
v.Parent.Parent.TextButton.Visible = true
if v.Parent.Parent.Parent.Parent.Name == "Screen1" then
game.ReplicatedStorage.Changevalue1:FireServer(v)
elseif v.Parent.Parent.Parent.Parent.Name == "Screen2" then
game.ReplicatedStorage.Changevalue2:FireServer(v)
elseif v.Parent.Parent.Parent.Parent.Name == "Screen3" then
game.ReplicatedStorage.Changevalue3:FireServer(v)
elseif v.Parent.Parent.Parent.Parent.Name == "Screen4" then
game.ReplicatedStorage.Changevalue4:FireServer(v)
elseif v.Parent.Parent.Parent.Parent.Name == "Screen5" then
game.ReplicatedStorage.Changevalue5:FireServer(v)
elseif v.Parent.Parent.Parent.Parent.Name == "Screen6" then
game.ReplicatedStorage.Changevalue6:FireServer(v)
elseif v.Parent.Parent.Parent.Parent.Name == "Screen7" then
game.ReplicatedStorage.Changevalue7:FireServer(v)
elseif v.Parent.Parent.Parent.Parent.Name == "Screen8" then
game.ReplicatedStorage.Changevalue8:FireServer(v)
elseif v.Parent.Parent.Parent.Parent.Name == "Screen9" then
game.ReplicatedStorage.Changevalue9:FireServer(v)
elseif v.Parent.Parent.Parent.Parent.Name == "Screen10" then
game.ReplicatedStorage.Changevalue10:FireServer(v)
end
local tweeninfo = TweenInfo.new(1,Enum.EasingStyle.Bounce)
local goals = {Position = UDim2.new(0.42, 0,1, 0)}
local tween = tweenservice:Create(button,tweeninfo,goals)
tween:Play()
end
end
end)
game.ReplicatedStorage.Claimbuttonvisible3.OnClientEvent:Connect(function(v)
v.Parent.Visible = false
v.Parent.Parent.TextButton.Visible = true
end)