I’m making a character selection GUI
but the GUI shows up in-Studio but in-game it doesn’t
looks in studio
looks in game
i don’t know what wrong here
here is how the explorer is organized
There’s a script that generates the character icons
a LocalScript named mainScript
characters = game.ReplicatedStorage.characters
content = script.Parent.mainFrame.ScrollingFrame
wait()
for i,v in pairs(characters:GetChildren()) do
if v:FindFirstChild('Humanoid') then
local ViewportFrame = Instance.new("ViewportFrame")
ViewportFrame.Parent = content
ViewportFrame.BackgroundTransparency = 1
local Button = Instance.new("TextButton")
Button.Parent = ViewportFrame
Button.Position = UDim2.new(0,0,1,0)
Button.Size = UDim2.new(1,0,0,15)
Button.BorderSizePixel = 0
Button.BackgroundColor3 = Color3.fromRGB(255,255,255)
Button.Text = v.Name
Button.TextScaled = true
local Preview = v:Clone()
Preview.Parent = ViewportFrame
local Camera = Instance.new("Camera")
Camera.Parent = ViewportFrame
Camera.CFrame = Preview.Head.CFrame + Preview.Head.CFrame.LookVector * 5
Camera.CFrame = CFrame.new(Camera.CFrame.Position,Preview.Head.Position)
ViewportFrame.CurrentCamera = Camera
changeLocal = script.Parent:FindFirstChild("changeLocal"):Clone()
changeLocal.Parent = Button
changeLocal.Disabled = false
local stringValue = Instance.new('StringValue')
stringValue.Parent = Button
stringValue.Value = v.Name
stringValue.Name = 'CharacterName'
Button.MouseButton1Click:Connect(function()
script.Parent.Enabled = false
end)
end
end
Another script
LocalScript changeLocal
local changeEvent = game.ReplicatedStorage:WaitForChild("setSubject")
local characterValue = script.Parent:WaitForChild("CharacterName")
local isCool = false
local coolTime = 1
script.Parent.MouseButton1Click:Connect(function(player)
if isCool == false then
isCool = true
local charactername = characterValue.Value
changeEvent:FireServer(charactername)
end
end)
changeEvent.OnClientEvent:Connect(function()
wait(coolTime)
isCool = false
end)
any help would be great (: