generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: LocalScript not working in game mode.

Previous Thread :: Next Thread 
DracoTrainingMaster is not online. DracoTrainingMaster
Top 100 Poster
Joined: 14 Oct 2006
Total Posts: 524
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 is not online. IcyFires
Joined: 29 Jun 2013
Total Posts: 5046
23 Oct 2014 08:50 PM
Must be a descendant of the player.
Report Abuse
DracoTrainingMaster is not online. DracoTrainingMaster
Top 100 Poster
Joined: 14 Oct 2006
Total Posts: 524
23 Oct 2014 08:50 PM
I don't know what you mean by that...
Report Abuse
IcyFires is not online. IcyFires
Joined: 29 Jun 2013
Total Posts: 5046
23 Oct 2014 08:51 PM
Put the localscript in starterpack or startergui
Report Abuse
DracoTrainingMaster is not online. DracoTrainingMaster
Top 100 Poster
Joined: 14 Oct 2006
Total Posts: 524
23 Oct 2014 08:54 PM
I have it in StarterGui.

It's
StarterGui
-ScreenGui
--LocalScript
--Frame
--Other stuff...
Report Abuse
DracoTrainingMaster is not online. DracoTrainingMaster
Top 100 Poster
Joined: 14 Oct 2006
Total Posts: 524
23 Oct 2014 09:02 PM
Hello...
Report Abuse
IcyFires is not online. IcyFires
Joined: 29 Jun 2013
Total Posts: 5046
23 Oct 2014 09:03 PM
Any output?
Report Abuse
DracoTrainingMaster is not online. DracoTrainingMaster
Top 100 Poster
Joined: 14 Oct 2006
Total Posts: 524
23 Oct 2014 09:11 PM
No, it's like the script isn't even there...
Report Abuse
DracoTrainingMaster is not online. DracoTrainingMaster
Top 100 Poster
Joined: 14 Oct 2006
Total Posts: 524
24 Oct 2014 12:36 AM
Bump
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image