Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I put a decal on a screen with the a button?

Asked by 4 years ago
Screen = script.Parent.Parent.Screen
Image = {"https://web.roblox.com/library/2945092805/Images-hi"}

function onClicked()
    script.Parent.ClickDetector.MouseClick:Connect(onClicked)
    Screen.Decal.Texture = Image [math.random(1, #Image)]
end
script.Parent.Touched:connect(onTouched)
script.Parent.ClickDetector.MouseClick:Connect(onClicked)

The output was putting out errors and I did not know what to do.

0
Wait so when the person presses the A key the decal should show up or close? ahsan666666666666 264 — 4y

1 answer

Log in to vote
0
Answered by
0_2k 496 Moderation Voter
4 years ago
Edited 4 years ago

You never want to use an actual link, but I will revise this

local screen = script.Parent.Parent.Screen
local imageID = {2945092805, 000, 000} -- other ID's

script.Parent.ClickDetector.MouseClick:Connect(function() -- click event
    Screen.Decal.Texture = "rbxassetid://"..imageID[math.random(1, #imageID)] -- choosing a random id from your array
end)
Ad

Answer this question