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

Why does this GUI not update to an X symbol during a live game? [closed]

Asked by
tran18 -5
6 years ago

In this game, I'm trying to have a target system where you have to hunt down an NPC with a specific color hat. A GUI is used to tell a player what colored hat the NPC is wearing, and the GUI is supposed to display an X symbol during the delay where the new target is chosen.

The part of the script which finds the hat color that the NPC is wearing and updates the GUI works, but it doesn't display an X during the delay in which a new target is chosen and the old NPC respawns. (this is a 5 second delay if you need to know)

I didn't make the respawn script, so I'm not 100% sure how it works. I'm pretty sure it's not an issue with waiting for the player to spawn in. But I tried to make comments to make it a bit readable.

local script that changes the GUI

01--local script found in starter GUI under imagelabel
02_G.isCamperDead = false
03local counter = 1
04 
05--array filled with symbols
06campColorArray = {
07                 "http://www.roblox.com/asset/?id=2254302918", --red hat
08                 "http://www.roblox.com/asset/?id=2254302303", --blue hat
09                 "http://www.roblox.com/asset/?id=2254331503", --yellow hat
10                 "http://www.roblox.com/asset/?id=2254302721", --cyan hat
11                 "http://www.roblox.com/asset/?id=2254302522", --camo hat
12                 "http://www.roblox.com/asset/?id=2256726772"  --x
13                 }
14function camperAlive()
15    if _G.isCamperDead == false then
View all 39 lines...

respawn script

01--script found in target NPC
02target = script.Parent:clone()
03local campsite = game.Workspace.campingSite.camper1
04_G.isCamperDead = false
05 
06function Dead()
07    _G.isCamperDead = true
08    game.StarterGui.TargetGui.TargetHat.Image = "http://www.roblox.com/asset/?id=2256726772" --attempt to change the player's gui to an x
09    wait(5) --delay between respawn
10 
11    local respawn=target:clone()
12    respawn.Parent=script.Parent.Parent
13    respawn:makeJoints()
14    script.Parent:remove()
15 
View all 25 lines...

Closed as Not Constructive by User#19524

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?