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: Why Will This Only Work In Studio Mode?

Previous Thread :: Next Thread 
gunter5 is not online. gunter5
Joined: 15 Mar 2011
Total Posts: 737
22 Sep 2014 09:41 PM
i was curious as to why this only works in studio build mode... and not when i go to actually play my game any help is appreciated!





local enabled = true
local Hold = true
Player = script.Parent.Parent
mouse = Player:GetMouse()
run = game:GetService("RunService")
Human = Player.Character:FindFirstChild("Humanoid")

if not enabled then return end
enabled = false

-------------------------------------------ORB FUNCTION--------------------------------------------

function onkeydown(key)
key = key:lower()
if key == "r" then
Hold = true
BrickSize()
end
end

NewMana = Instance.new("NumberValue", Player.Character)
NewMaxMana = Instance.new("NumberValue", Player.Character)
NewMana.Name = "Mana"
NewMaxMana.Name = "MaxMana"
Mana = Player.Character.Mana
MaxMana = Player.Character.MaxMana
Mana.Value = 400
MaxMana.Value = 400

Removal = script.Removal:clone()
Weld = Instance.new("Weld")

function BrickSize()
size = 0
Human.WalkSpeed = 0
Blast = Instance.new("Part", Workspace)
Removal.Parent = Blast
Removal.Disabled = false
Blast.Name = "FireEle"
Blast.Shape = "Ball"
Blast.TopSurface = "Smooth"
Blast.BottomSurface = "Smooth"
Blast.BrickColor = BrickColor.new("Bright red")
Blast.Transparency = .5
Blast.CanCollide = true
Blast.CFrame = Player.Character.Torso.CFrame * CFrame.new(0, 0, -10)
------------
Weld.Part0 = Player.Character.Torso
Weld.C0 = Player.Character.Torso.CFrame:inverse()
Weld.Part1 = Blast
Weld.C1 = Blast.CFrame:inverse()
Weld.Parent = Blast
------------
Mesh = Instance.new("SpecialMesh", Blast)
Mesh.MeshType = "Sphere"
Mesh.Scale = Vector3.new(.1,.1,.1)
while Hold == true do
wait(.1)
size = size +.1
Mana.Value = Mana.Value -4
Mesh.Scale = Vector3.new(size,size,size)
if Mesh.Scale == Vector3.new(4,4,4) then
break
end
if Mana.Value <= 0 then
break
end
print("You Have Counted To Size: "..size..".")
end
wait(1)
enabled = true
end


function onkeyup(key)
key = key:lower()
if key == "r" then
BV = Instance.new("BodyVelocity", Blast)
BV.maxForce = Vector3.new(math.huge, math.huge, math.huge)
BV.velocity = Player.Character.Torso.CFrame.lookVector*80
Blast.CanCollide = false
wait(.1)
Blast:BreakJoints()
game.Debris:AddItem(Blast, 5)
Human.WalkSpeed = 16
Hold = false
end
end

mouse.KeyUp:connect(onkeyup)
mouse.KeyDown:connect(onkeydown)

-------------------------------------------ORB FUNCTION-------------------------------------------
local Hold2 = true

function onkeydown2(key)
key = key:lower()
if key == "t" then
Hold2 = true
RegenMana()
end
end

function RegenMana()
Human.WalkSpeed = 0
while Hold2 == true do
wait(.1)
Mana.Value = Mana.Value +2
if Mana.Value >= 400 then
Mana.Value = 400
wait(.1)
end
if Mana.Value >= 400 then
wait(1)
break
end
end
end

function onkeyup2(key)
key = key:lower()
if key == "t" then
Human.WalkSpeed = 16
Hold2 = false
end
end


mouse.KeyUp:connect(onkeyup2)
mouse.KeyDown:connect(onkeydown2)
Report Abuse
slayer1928 is not online. slayer1928
Joined: 19 Feb 2010
Total Posts: 32
23 Sep 2014 12:05 AM
Is there any errors when you run it???? More info please.
Report Abuse
gunter5 is not online. gunter5
Joined: 15 Mar 2011
Total Posts: 737
10 Oct 2014 06:37 PM
well it seems to create the orb fine. except i cannot turn when i am creating the orb, the gui does not decrease, and the orb unwelds when it hits its max size..
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
10 Oct 2014 07:07 PM
Is it a local script
Report Abuse
cole7778 is not online. cole7778
Joined: 19 Nov 2009
Total Posts: 7827
10 Oct 2014 07:47 PM
if its a local script make it a server script and vise versa

About $207,000/1,500,000
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