NOTE: This is a regular/Server Script not a Local Script
I have this inside a GUI button...
01 | local Gui = script.Parent |
02 | local Player = Gui.Parent.Parent.Parent |
03 | local Char = Player.Character |
04 | local save = Player:FindFirstChild( "Save" ) |
05 | local part = save:FindFirstChild( "Part" ) |
06 |
07 |
08 | function onClicked() |
09 | if save ~ = nil then |
10 | while wait() do |
11 | if part ~ = nil then |
12 | local loadpart = Instance.new( "Part" ,game.Workspace) |
13 | loadpart.Anchored = true |
14 | loadpart.CFrame = CFrame.new(Vector 3. new(part.pos.X.Value,part.pos.Y.Value,part.pos.Z.Value)) |
15 | part:remove() |
16 | end |
17 | end |
18 | end |
19 | end |
20 | Gui.MouseButton 1 Click:connect(onClicked) |
****Outlines**** ****** I Have a String value called Save inside the Player****** ****** I have A string value called part inside save****** ****** I have a String Value called pos inside part****** ****** I have 3 IntValues called X, Y, and Z inside pos******
I dont know why this scripts not working.... Ive tryed almost everything...
So i read the concept of your script and made a basic version of it
01 | player = game.Players.LocalPlayer |
02 |
03 | mouse = player:GetMouse() |
04 | save = player.Backpack.Save |
05 | part = save.Part |
06 | pos = part.pos |
07 | x = pos.X |
08 | y = pos.Y |
09 | z = pos.Z |
10 | script.Parent.MouseButton 1 Down:connect( function () |
11 | print ( "clicked" ) |
12 | while wait() do |
13 | local loadpart = Instance.new( "Part" ,game.Workspace) |
14 | loadpart.Size = Vector 3. new( 2 , 5 , 2 ) |
15 | loadpart.Anchored = true |
16 | loadpart.CFrame = CFrame.new(part.pos.X.Value,part.pos.Y.Value,part.pos.Z.Value) |
17 | end |
18 | end ) |
This should be in a local script inside of a textbutton. i took away your if statments for the purpose of testing. for XYZ i put them inside of values inside of the player's backpack via starterpack. You can see for yourself here : https://gyazo.com/cfce730a78285c75c29b55bfd38f4920 you can ignore everything except for the values. I also changed that Vector3 inside of the CFrame. Since CFrames are written in the form of 3 numbers, Vector3.new isnt needed. I also took away the part:Remove() b/c it removes the value part making it impossible to reuse the button. You can edit this as you will, but this is the basic concept of it