edit: fixed read last comment
I've looked at other questions similar to mine asked on this site, in fact that's what brought me here to ask instead of the Robloxforum. The general fix to the issue of scripts/guis not working in-game when they appear to work in studio is to use the F9 console, or dev console in-game to try and figure out the bug.
In my case, I can't see anything on the console in-game, as if my code isn't being picked up at ALL when loaded into the Roblox game.
Here is my code, it's been put in a Local Script and a normal Script with no difference in-game. I know it's extremely ineffective coding, but Roblox seems to have deprecated most of the features I used before taking a break.
TL;DR, Title - f9 console doesn't show anything
print("test")
PID = script.Parent.PokemonID.Value
function unselect()
local children = script.Parent:GetChildren()
for i = 1,#children do
if children[i].ClassName == "ImageButton" and children[i].Chosen.Value == true then
print("Unselected " .. children[i].Name)
children[i].Chosen.Value = false
children[i].BorderSizePixel = 2
children[i].BorderColor3 = Color3.fromRGB(35,35,35)
children[i]:TweenSize(UDim2.new(0, 80, 0, 80), "In", "Quad", .2)
end
end
end
script.Parent.P1.MouseButton1Click:connect(function()
clicked = script.Parent.P1
PID = clicked.PokemonID.Value
unselect()
clicked.Chosen.Value = true
clicked.BorderSizePixel = 3
clicked.BorderColor3 = Color3.fromRGB(57,141,230)
clicked:TweenSize(UDim2.new(0, 90, 0, 90), "Out", "Quad", .2)
print(PID)
print(clicked.NameLabel.Text)
end)
script.Parent.P4.MouseButton1Click:connect(function()
clicked = script.Parent.P4
PID = clicked.PokemonID.Value
unselect()
clicked.Chosen.Value = true
clicked.BorderSizePixel = 3
clicked.BorderColor3 = Color3.fromRGB(57,141,230)
clicked:TweenSize(UDim2.new(0, 90, 0, 90), "Out", "Quad", .2)
print(PID)
print(clicked.NameLabel.Text)
end)
script.Parent.P7.MouseButton1Click:connect(function()
clicked = script.Parent.P7
PID = clicked.PokemonID.Value
unselect()
clicked.Chosen.Value = true
clicked.BorderSizePixel = 3
clicked.BorderColor3 = Color3.fromRGB(57,141,230)
clicked:TweenSize(UDim2.new(0, 90, 0, 90), "Out", "Quad", .2)
print(PID)
print(clicked.NameLabel.Text)
end)
script.Parent.P25.MouseButton1Click:connect(function()
clicked = script.Parent.P25
PID = clicked.PokemonID.Value
unselect()
clicked.Chosen.Value = true
clicked.BorderSizePixel = 3
clicked.BorderColor3 = Color3.fromRGB(57,141,230)
clicked:TweenSize(UDim2.new(0, 90, 0, 90), "Out", "Quad", .2)
print(PID)
print(clicked.NameLabel.Text)
end)
Thanks.

2 comments
That looks impossible to read. How do I make it look like code?
Ah god. The problem was with my team-create stupidity. I have to close a script in order for it to update with the rest of the game. Sorry for your time, scripting helpers.