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

Part tool wont change position why????

Asked by
lo_1003 42
4 years ago

I wan't to change my handle position to a part1 position and set a part1 transparency to 1 but somehow the handle position didnt change but part1 transparency did except the other script that i got from my first question:

my localscript:

local player = game:GetService("Players")
script.Parent.Activated:Connect(function()
    script.Parent.RemoteEvent:FireServer()
end)

my serverscript:

script.Parent.OnServerEvent:Connect(function(plr)
    script.Parent.Parent.Handle.Position = Script.Parent.Parent.Part1.Position
    script.Parent.Parent.Part1.Transparency = 1
end)


the local script from my 1 question answer:

local tool = script.Parent
       local player = game:GetService("Players")
       script.Parent.Activated:Connect(function()
       script.Parent.RemoteEvent:FireServer()
end)

the script from my 1 question answer:

script.Parent.OnServerEvent:Connect(function(plr)
    plr.Backpack:FindFirstChild("Tool").Handle.Position = plr:FIndFirstChild("Tool").Part1.Position
    plr:FindFirstChild("Tool").Part1.Transparency = 1
end)

help!!

2 answers

Log in to vote
0
Answered by 4 years ago

Probably because on your serverscript on line 2 you accidentally added a capital S to the script. It should be:

script.Parent.Parent.Handle.Position = script.Parent.Parent.Part1.Position
Ad
Log in to vote
0
Answered by 4 years ago

Make sure that your ServerScripts are in somewhere like ServerScriptService. Another thing is that your RemoteEvents should be in somewhere Replicated such as ReplicatedStorage.

Now, as @floopix said, you put an uppercase S instead of a lowercase s.

This will most likely be the problem. I hope this helps you in your Scripting Career!

Answer this question