Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Script doesn't work on published version only at studio?

Asked by
npott13 23
7 years ago
Edited 7 years ago

This script is inside a textbutton , it works on studio but on published version it's not.


local mouse = game.Players.LocalPlayer:GetMouse() local ply = game.Players.LocalPlayer.Name a = game.ReplicatedStorage.TestModel:clone() script.Parent.MouseButton1Click:connect(function() a.Parent = game.Workspace a:MakeJoints() mouse.TargetFilter = a a:MoveTo(Vector3.new(mouse.Hit.p.X, mouse.Hit.p.Y + (a:GetExtentsSize().Y / 2), mouse.Hit.p.Z)) a:MoveTo(Vector3.new(mouse.Hit.p.X, mouse.Hit.p.Y, mouse.Hit.p.Z)) target = game.Players.LocalPlayer:GetMouse().Hit game.Workspace.TestModel.plyName.Value = ply print("cloned") end)

Developer console log http://i.imgur.com/vQ30xiC.jpg

0
clone is only called once, you need to place it inside the event with the function. scottmike0 40 — 7y
0
It has to be localscript. npott13 23 — 7y

1 answer

Log in to vote
0
Answered by
npott13 23
7 years ago

Nvm, it has to be localscript.

Ad

Answer this question