My local script doesnt change the visibility of my map icon

recently iv been trying to make a round system which shows the map image of the current map using a remote event from my modular script that fires the maps name and if visibility should be true or not i fire it to all clients it works the first time and after that it does not become visible but it fires visible and passes on like it did the job iv had tried many methods it will ither not load the image or it will fully be invisible. heres the code:

local player = game.Players.LocalPlayer
local Rep = game:GetService("ReplicatedStorage")
local StatusSet = Rep.Events.Remote.RE_StatusImage
local BoarderMapFrame = player.PlayerGui:WaitForChild("ComputerGui").RoundStatus:WaitForChild("BorderMapFrame")
local Map = BoarderMapFrame.MapFrame
local MapImages = Rep.MapImages
StatusSet.OnClientEvent:Connect(function(ChosenMapID, Visibility)
	print("Fired Image Change")
	if Visibility == true then
		BoarderMapFrame.Visible = true
		BoarderMapFrame.Visible = false
	for i,v in pairs(Rep.MapImages:GetChildren()) do
		if v.Name == ChosenMapID then
			Map.Image = v.Image

local status = Rep.Status

local statusUI = player.PlayerGui.ComputerGui.RoundStatus.StatusFrame.RoundStatus

	print("Fired Text Change")
	statusUI.Text = value
1 Like

Firstly, can you please format your code correctly? It looks really messy at the moment. Secondly, can you record a video and telling us the problem using proper words? Sorry for sounding rude but I can’t really understand the problem here.

im currently trying to fix the formating im just gonna send it in an image form and make a video showing what happens

All you had to do is to just copy the whole code, and place it between the lua block…


Just make sure the whole code is encapsulated in between the triple backquotes at both the beginning and the end.

fixed the formating do you still need a video

A video demonstrating the bug can defnitely help us…

the script works the first time and after that it doesnt

So the problem is, the script, on first time, shows the client the selected map frame, and the second time the script does thes ame thing, fails to show the map frame? Is that the problem?

yes, or even load the image as shown in the first round.

heres a clip of the script that calls it in the first place

local ChosenMap = Maps[math.random(1, #Maps)]
	Map = ChosenMap:Clone()
	Map.Parent = game.Workspace
	CurrentMapID = ChosenMap.Name
	Visibility = true


and the one that removes it

	CurrentMapID = nil
	Visibility = false

Sorry for the late reply, but can you check if the MapFrame still exist when the game selects a second map in the second intermission? Check if it still exists and check the Visible property.

huh it stops existing thats strange we never destroy it anywhere???

nope it actually doesnt exist after the first after using :FindFirstChild() it doesnt exist

do you have discord? if u do and are willing to help we can go on there

the issue was fixed by just moving one out of the other and then setting them as locals every time a new round started now for some reason it doesnt get deleted and icons load i still dont know whats the bug but at least it works

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.