How can I translate local part position to server

I’m trying to make script that translates local part to server, using remote events. And i got a problem that I don’t know how to translate it.
I already tried to make script but got an error “Unable to assign property Position. Vector3 expected, got nil”

Heres the code

server

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local CreateHitP = ReplicatedStorage:WaitForChild("CreateHitPart")

CreateHitP.OnServerEvent:Connect(function(plr, val)
	local Part = Instance.new('Part')
	Part.Parent = workspace
	Part.Position = val
	Part.CanCollide = false
	Part.CanTouch = false
	Part.CanQuery = false
	Part.Anchored = true
	Part.Size = Vector3.new(.4,.4,.1)
end)

local

val = Part.Position

I think its very simple to fix but i can’t figure it out.

Can you show the code of you firing the event?
This error means that when the event was fired, the variable val was nil (meaning not existing).

lol it fixed itself, I run it again and it worked. Sorry

becareful while using remote events make sure that to check whats being sended exploiters may use that to make a lot of stuff

what i mean is they can change the val to another value and trust me they will find someway to ruin the game

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.