Hello, I need some help with this LocalScript inside a BillboardGui to change the Parent's (ImageButton) Image depending on what device the player is on. There are no errors, and nothing happens.
local uis = game:GetService('UserInputService') local mobile = uis.TouchEnabled local console = uis.GamepadEnabled local pc = not (mobile or console) if mobile then script.Parent.Image = ("rbxassetid://995969403") script.Parent.MouseButton1Down:Connect(function(Player) script.Parent.Image = ("rbxassetid://995969938") end) script.Parent.MouseButton1Up:Connect(function(Player) script.Parent.Image = ("rbxassetid://995969403") end) else if console then script.Parent.Image = ("rbxassetid://995987760") script.Parent.MouseButton1Down:Connect(function(Player) script.Parent.Image = ("rbxassetid://995988254") end) script.Parent.MouseButton1Up:Connect(function(Player) script.Parent.Image = ("rbxassetid://995987760") end) else if pc then script.Parent.Image = ("rbxassetid://995986660") script.Parent.MouseButton1Down:Connect(function(Player) script.Parent.Image = ("rbxassetid://995987092") end) script.Parent.MouseButton1Up:Connect(function(Player) script.Parent.Image = ("rbxassetid://995986660") end) end end
local uis = game:GetService('UserInputService') local mobile = uis.TouchEnabled local console = uis.GamepadEnabled local pc = not (mobile or console) if mobile then script.Parent.Image = ("rbxassetid://995969403") script.Parent.MouseButton1Down:Connect(function(Player) script.Parent.Image = ("rbxassetid://995969938") end) script.Parent.MouseButton1Up:Connect(function(Player) script.Parent.Image = ("rbxassetid://995969403") end) elseif console then script.Parent.Image = ("rbxassetid://995987760") script.Parent.MouseButton1Down:Connect(function(Player) script.Parent.Image = ("rbxassetid://995988254") end) script.Parent.MouseButton1Up:Connect(function(Player) script.Parent.Image = ("rbxassetid://995987760") end) else script.Parent.Image = ("rbxassetid://995986660") script.Parent.MouseButton1Down:Connect(function(Player) script.Parent.Image = ("rbxassetid://995987092") end) script.Parent.MouseButton1Up:Connect(function(Player) script.Parent.Image = ("rbxassetid://995986660") end) end
Your ends were wrong all over the place. Studio would have warned you there was an error with eof. I find it hard to believe that there were no errors.