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 » Scripters
Home Search
 

Re: Works in Studio but not online?

Previous Thread :: Next Thread 
DispenseTheDispenser is not online. DispenseTheDispenser
Joined: 20 Jun 2013
Total Posts: 2268
30 Jan 2015 10:04 PM
This script is inside a tool, it works fine on Studio but not online. Help?

val = nil

script.Parent.Equipped:connect(function(mouse)
local plr = game.Players:GetPlayerFromCharacter(script.Parent.Parent)
script.Parent.Activated:connect(function()
local targ = mouse.Target
if targ ~= nil then
if targ.className == "Part" then
local child = targ:FindFirstChild('ThisIsABlock')
if child ~= nil then
local m = (script.Parent.Parent.Torso.Position - mouse.Target.Position).magnitude
if m <= 30 then
local a = mouse.TargetSurface
if mouse.TargetSurface == Enum.NormalId.Top then
val = 1
elseif mouse.TargetSurface == Enum.NormalId.Bottom then
val = 2
elseif mouse.TargetSurface == Enum.NormalId.Back then
val = 3
elseif mouse.TargetSurface == Enum.NormalId.Front then
val = 4
elseif mouse.TargetSurface == Enum.NormalId.Right then
val = 5
elseif mouse.TargetSurface == Enum.NormalId.Left then
val = 6
end
local blocktype = plr.PlayerGui.BlockValue
if blocktype.Value == 1 then
newblock = game.Lighting.block:Clone()
elseif blocktype.Value == 2 then
newblock = game.Lighting.spawn:Clone()
else newblock = game.Lighting.decal:Clone()
local newblockchildren = newblock:GetChildren()
for i = 1, #newblockchildren do
if newblockchildren[i].className == "Decal" then
newblockchildren[i].Texture = "rbxassetid://"..plr.PlayerGui.DecalValue.Value
end
end
end
newblock.Parent = game.Workspace.World
newblock.BrickColor = game.Players.LocalPlayer.PlayerGui.ColorValue.Value
if val == 1 then
newblock.CFrame = targ.CFrame + Vector3.new(0,4,0)
elseif val == 2 then
newblock.CFrame = targ.CFrame + Vector3.new(0,-4,0)
elseif val == 3 then
newblock.CFrame = targ.CFrame + Vector3.new(0,0,4)
elseif val == 4 then
newblock.CFrame = targ.CFrame + Vector3.new(0,0,-4)
elseif val == 5 then
newblock.CFrame = targ.CFrame + Vector3.new(4,0,0)
elseif val == 6 then
newblock.CFrame = targ.CFrame + Vector3.new(-4,0,0)
end
script.Parent.Handle.Sound:Play()
end
end
end
end
end)
end)
Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
30 Jan 2015 10:07 PM
didnt read the script very much but use local scripts in tools
Report Abuse
DispenseTheDispenser is not online. DispenseTheDispenser
Joined: 20 Jun 2013
Total Posts: 2268
30 Jan 2015 10:10 PM
But why does it work in Studio but not online?

Bump.
Report Abuse
Paramedic4 is not online. Paramedic4
Joined: 23 Jan 2011
Total Posts: 5934
30 Jan 2015 10:14 PM
Because everything in solo mode is client sided.
Report Abuse
DispenseTheDispenser is not online. DispenseTheDispenser
Joined: 20 Jun 2013
Total Posts: 2268
30 Jan 2015 10:16 PM
Then how can I fix this?
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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