|
| 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
|
  |
| 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 |
|
|
| 30 Jan 2015 10:10 PM |
But why does it work in Studio but not online?
Bump. |
|
|
| Report Abuse |
|
|
| 30 Jan 2015 10:14 PM |
| Because everything in solo mode is client sided. |
|
|
| Report Abuse |
|
| |