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

Pop-Up Images and Sounds?

Asked by 10 years ago

Hi,

I am making a 'scary' game and want an image to pop-up when you touch a brick.

I want it so that I walk through a brick and an image pops up and a noise come on also at the same time. I also want it so that the music and sounds are individual to each player so when I touch the brick, I can hear the scream in my game but others cannot in their game.

So in other words what would the script be when I touch a brick and a picture pops up and sound but only appearing on the screen of the person touching it?

Please help?

Thanks Kieran

1 answer

Log in to vote
3
Answered by 10 years ago

easy

Put your ScaryPopup named 'ScaryPopup00' inside Lighting and the Scary sound inside lighting too but named 'ScarySong'

Put this script inside your part:

script.Parent.Touched:connect(function(p)
if (p.Parent:findFirstChild('Humanoid')~=nil) then --Finding out player
if p.Parent.Name~='Workspace' then --Security Check for Scary Game Parts
local Pl = game:service('Players'):GetPlayerFromCharacter(p.Parent)
if (Pl~=nil) then
local Prx = Pl.PlayerGui
if Prx~=nil then
--This is where we go
local Pop = game:service('Lighting'):WaitForChild('ScaryPopup00') -- The Popup
local Son = game:service('Lighting'):WaitForChild('ScarySong') -- The Song
Pop:Clone().Parent=Prx -- Making it appear in PlayerGui
Son:Clone().Parent=Prx
--BUT WHY PLAYERGUI!!!???
--PlayerGui cuz it's the only way to show stuff only for the player. Hope this helps you!

-- Console takes about 0.0000000000000000000000000000000000000000000000000000000205781023 seconds to read a line, so it's almost at exact same time.
end
end
end
end
end)
0
How do I get the pop up image into the Lighting? kieranm9090 49 — 10y
1
Just copy it and paste into lighting and then remove workspace one marcoantoniosantos3 200 — 10y
0
Won't let me copy and paste the decal into it or click and drag it. kieranm9090 49 — 10y
0
it cant be a decal! Must be an image box o.o marcoantoniosantos3 200 — 10y
View all comments (2 more)
0
Image box? kieranm9090 49 — 10y
0
Copy your decal's textureid, put a new ImageLabel into workspace, change it's ImageId (Or whatever the property is called) to decal's textureid and then copy the imagelabel and paste into lighting. There you go (REMEMBER TO RENAME!!) marcoantoniosantos3 200 — 10y
Ad

Answer this question