ok i know the solution its really sound stupid. Its just the typo error the ImageButton name “IsomatricRuin” and in my table its “IsometricRuin” lol.
but ur script look simple i might doing like ur instead
ok i know the solution its really sound stupid. Its just the typo error the ImageButton name “IsomatricRuin” and in my table its “IsometricRuin” lol.
but ur script look simple i might doing like ur instead
Hmm it should work well, I mean it worked for me… Ensure that all ImageButton names are different from each other and same spelling as the ones in the table.
One last question. I got the elevator all set up, now i want to do is a SurfaceGui to show what the image of the map. If i only have 1 elevators then no problem but if i has multi elevators then i only want the one that player sitting in have his map to show to that only one SurfaceGui of elevator.
Im on my phone rn. Will reply tomorrow
Hmm, if you were following my code from the start, I would probably add a main model that contains all the elevator models within and a “part”, called doors, within each elevator in which the player touches to know which elevator the same player has entered. In the same local script, I would add new variables “lift” and “elevators”.
[...]
--New things added
local lift = nil
local elevators = workspace:WaitForChild("Elevators"):GetDescendants() -- can be folder or model which has all the elevators inside and each elevator have a part called "Door".
for d, door in pairs(elevators) do
if door.Name == "Door" then -- checks a part named "Door"
door.Touched:Connect(function(hit)
local h = hit.Parent:FindFirstChildOfClass("Humanoid")
if h and h.Parent.Name == game.Players.LocalPlayer.Name then
lift = door.Parent.Name -- gets elevator name e.g, "Elevator1", a model within a model/folder called "Elevators"
end
end)
end
end
--
for _, map in pairs(maps) do
if map:IsA("ImageButton") then
map.MouseButton1Click:Connect(function()
chosen = map.Name
ChooseMapEvent:FireServer(chosen, lift) -- collects both the map name and elevator's name
end)
end
end
Then, from there you could probably do: workspace.Elevators[lift].SurfaceGui.MapDisplay.Image = "IMAGE ID"
in the onserverevent script. So, it changes that particular elevator’s image to the map the player has chosen.
Alternatively, in the local script you could quickly grab the elevator itself
if h then
lift = door.Parent
end
then in the onserverevent: lift:FindFirstChild("SurfaceGui").MapDisplay.Image = "IMAGE ID"
I haven’t tested this all out, so im quite uncertain but please do let me know if it works or not.
ok i will try this out when i wake up. I need to take a nap. Thanks man
i got it. ur script work gotta figure out how do i reset the image and the countdown in my elevator? should i fire another event when player exit the touch zone or click exit button?
Any options are fine as long as you know what you are doing.
just set the image id empty and countdown back to original number e.g. ImageDisplay.Image = ""
and Countdown = 10