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

big chungus gui not appearing when touching button help?

Asked by 6 years ago

so basically i have a big chungus image gui inside starter gui but its invisible so it only turns visible when a player touched a door so the big chungus turns visible and it covers the whole screen and so the player freaks out (jumpscare). ill also add horror murdering scene scream after but thats up for another question the thing with the big chungus image is that its not appearing when player touches the door and idk why ive been trying for 2 hours now and nothing will do so yeah guys pls help me heres my big chungus code:

local bigchungusscreamer = game.StarterGui.BIGCHUNGUS.Image
local door = game.Workspace.HauntedMansion.Hall.Door

door.Touched:Connect(function(part)
    if part.Parent:FindFirstChild("Humanoid") then
        bigchungusscreamer.Visible = true
        part.Parent.Player:Kill()
    end
end)

also pls help me make it so the player who touches the door dies but doesnt respawn so it has to endure the whole screaming and chungus screamer ntil he leaves the game the script is not working on that aspect either

0
You put game.StarterGui. You can't edit a GUI from the starterGui. Instead put local gui = game.Players.LocalPlayer.PlayerGui.BIGCHUNGUS.Image tonyv537 95 — 6y
0
when a player plays, all the startergui is put into the PlayerGui tonyv537 95 — 6y
0
ok going to test it out thx in advance RodrigatorOP 172 — 6y
0
i tested it and it workd on studio but when i tried it on server it didnt RodrigatorOP 172 — 6y

1 answer

Log in to vote
0
Answered by
starmaq 1290 Moderation Voter
6 years ago

So, guis are a local sided object, and when you did local bigchungusscreamer = game.StarterGui.BIGCHUNGUS.Image you were refrecing the gui that is in startergui so it won't show up because when a player join all StarterGui's desendants are put in game.Players.LocalPlayer.PlayerGui. So you're script gotta be in a local script (since LocalPlayer can only be done inside a local script)

local Player = game:GetService("Players").LocalPlayer
local bigchungusscreamer = Player.PlayerGui.BIGCHUNGUS.Image -- put your guis here
local door = game.Workspace.HauntedMansion.Hall.Door
    door.Touched:Connect(function(part)
        if part.Parent:FindFirstChild("Humanoid") then
                bigchungusscreamer.Visible = true
                part.Parent.Player:Kill()
        end
    end)

Ad

Answer this question