Basically I am trying to replicate a Ultimate Driving Westover Islands where they is a image of a Skyline probably and if you click it than press spawn the certain model spawns. To make this clear I need a script where I can put inside a yes button or a image button where if I click on that t will spawn in a certain model located in ServerStorage and the GUI will disappear.
Not played the game but by your description it seems pretty straight-forward.
For the image of a skyline create an ImageLabel
and put it in a ScreenGui
, then to make the image cover the entire screen, use the following;
BackgroundImage.Size(UDim2.new(1, 0, 1, 40)) BackgroundImage.Position(UDim2.new(0, 0, 1, -40))
For the buttons create a TextButton
and put in in a ScreenGui
somewhere then insert a StringValue
with the value as the corresponding name of the vehicle in ReplicatedStorage
, then use the following code; (make sure to adapt it to your needs)
for i, v in pairs(ScreenGui:GetChildren()) do if v:IsA("TextButton") then v.MouseButton1Click:Connect(function() ScreenGui.Enabled == false -- This 'closes' the GUI. Vehicle = game.ReplicatedStorage:FindFirstChild(v.StringValue.Value):Clone() -- This finds the vehicle and clones it. Vehicle.Parent = game.Workspace end) end end
I made this off the top of my head so it may have some errors but if you know basic scripting then you should be able to sort them out.
I hope this helps.
Closed as Not Constructive by H4X0MSYT, Vulkarin, DevNetx, and BlueTaslem
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?