01 | local player = game.Players.LocalPlayer |
02 | local plot |
03 |
04 | local function MoveChar(char) |
05 | wait( 0.1 ) |
06 |
07 | char:SetPrimaryPartCFrame(CFrame.new(plot.Plot.Spawn.CFrame.X,plot.Plot.Spawn.CFrame.Y + 5 , plot.Plot.Spawn.CFrame.Z)) |
08 | end |
09 |
10 | player.CharacterAdded:Connect( function (char) |
11 | for i,v in pairs (workspace.Plots:GetChildren()) do |
12 | if v then |
13 | if v.Plot.Owner.Value = = player then |
14 | plot = v |
15 |
The reason your code is not working as you are not sending over the "Char" as an argument when running your custom funtion. Thats an easy fix. Use this:
01 | local player = game.Players.LocalPlayer |
02 | local plot |
03 |
04 | local function MoveChar(char) |
05 | wait( 0.1 ) |
06 |
07 | char:SetPrimaryPartCFrame(CFrame.new(plot.Plot.Spawn.CFrame.X,plot.Plot.Spawn.CFrame.Y + 5 , plot.Plot.Spawn.CFrame.Z)) |
08 | end |
09 |
10 | player.CharacterAdded:Connect( function (char) |
11 | for i,v in pairs (workspace.Plots:GetChildren()) do |
12 | if v then |
13 | if v.Plot.Owner.Value = = player then |
14 | plot = v |
15 |
dosent player.CharacterAdded only fire on the server? if not my bad