|
| 23 Oct 2014 08:48 PM |
Works fine in edit mode.
script.Parent.Open_Close.Text = "Loading" wait(5) script.Parent.Open_Close.Text = "Close" local sp = script.Parent local frame = sp.Frame local ply = game:GetService("Players").LocalPlayer local button = sp.Open_Close local op_D = false local op_OP = true local getClick = frame sp.Own_But.MouseButton1Click:connect(function() if(workspace:FindFirstChild(ply.Name.."_Animal")) then workspace:FindFirstChild(ply.Name.."_Animal"):Destroy() end end) button.MouseButton1Click:connect(function() if(op_D == false) then op_D = true print(button.Name.." has been clicked.") if(op_OP == true) then op_OP = false button.Text = "Open" frame:TweenPosition(UDim2.new(0, -115,0, 0), "In", "Quad") button:TweenPosition(UDim2.new(0, 10,0, 10), "In", "Quad") sp.Own_But:TweenPosition(UDim2.new(0, 10,0, 40), "In", "Quad") else op_OP = true button.Text = "Close" frame:TweenPosition(UDim2.new(0, 0,0, 0), "Out", "Quad") button:TweenPosition(UDim2.new(0, 125,0, 10), "Out", "Quad") sp.Own_But:TweenPosition(UDim2.new(0, 125,0, 40), "Out", "Quad") end wait(1.8) op_D = false else print("Waiting") end end) for _,v in pairs(getClick:GetChildren()) do v.MouseButton1Click:connect(function() get_WS = workspace:GetChildren() if(workspace:FindFirstChild(ply.Name.."_Animal")) then print("You own a pet.") else if(v:isA("ImageButton")) then if game.Workspace:FindFirstChild(ply.Name) ~= nil then print(ply.Name.." Clicked") local Part = Instance.new("Part") Part.Locked = true Part.CanCollide = false Part.Name = ply.Name.."_Animal" Part.Parent = workspace local Mesh = Instance.new("SpecialMesh") Mesh.TextureId = v.Mesh.TextureId Mesh.MeshId = v.Mesh.MeshId Mesh.Scale = v.Mesh.Scale Mesh.Parent = Part local BS = Instance.new("BodyPosition") BS.position = game.Workspace[ply.Name].Head.Position BS.Parent = Part local BG = Instance.new("BodyGyro") BG.maxTorque = Vector3.new(1e7, 1e7, 1e7) BG.Parent = Part if(v:FindFirstChild("Fire")) then v.Fire:Clone().Parent = Part end -- script = v.Script:Clone() -- script.Parent = Part -- script.Disabled = false while wait() do BS.position = game.Workspace[ply.Name].Head.Position + v.Pos.Value BG.cframe = game.Workspace[ply.Name].Head.CFrame end end end end end) end
|
|
|
| Report Abuse |
|
IcyFires
|
  |
| Joined: 29 Jun 2013 |
| Total Posts: 5046 |
|
|
| 23 Oct 2014 08:50 PM |
| Must be a descendant of the player. |
|
|
| Report Abuse |
|
|
| 23 Oct 2014 08:50 PM |
| I don't know what you mean by that... |
|
|
| Report Abuse |
|
IcyFires
|
  |
| Joined: 29 Jun 2013 |
| Total Posts: 5046 |
|
|
| 23 Oct 2014 08:51 PM |
| Put the localscript in starterpack or startergui |
|
|
| Report Abuse |
|
|
| 23 Oct 2014 08:54 PM |
I have it in StarterGui.
It's StarterGui -ScreenGui --LocalScript --Frame --Other stuff... |
|
|
| Report Abuse |
|
| |
IcyFires
|
  |
| Joined: 29 Jun 2013 |
| Total Posts: 5046 |
|
| |
|
| 23 Oct 2014 09:11 PM |
| No, it's like the script isn't even there... |
|
|
| Report Abuse |
|
| |