Hi, I wanted to make a part that is only to client sided, because of values would be overlapping every player in the game. When touched will give the player one point and shouldn’t give the other players a point.
Problem is if I have to make it client sided, I have the part inside of ReplicatedStorage.
Plus, I also have to make the player get a point when it’s touched.
Whilst doing that and running the local script (it’s a local script inside of StarterGui), the cloned part goes into Workspace, but it will give me an error saying Partq is not a valid member of Workspace “Workspace” (Partq is the part - which resets the players points - is cloned)
local ResetPPasdasd = game.ReplicatedStorage.Partq
local debounce = false
local bruh = ResetPPasdasd:Clone().Parent
local CPvalue = 2
bruh = game.Workspace
bruh.Partq.Touched:Connect(function(t)
if debounce == false then
debounce = true
bruh.CanTouch = false
if CPvalue == 2 then
print("no player point block touched, revert")
wait(1)
debounce = false
bruh.Partq.CanTouch = true
elseif CPvalue ~= 2 then
CPvalue = 2
print(CPvalue)
PP1.CanTouch = true
PP2.CanTouch = true
wait(1)
debounce = false
bruh.Partq.CanTouch = true
end
end
end)
local rs = game:GetService("ReplicatedStorage")
local partQ = rs:WaitForChild("Partq")
local bruh = partQ:Clone()
bruh.Parent = workspace
local CPvalue = 2
local debounce = false
local PP1 = nil --define this
local PP2 = nil --define this
bruh.Touched:Connect(function(t)
if not debounce then
debounce = true
bruh.CanTouch = false
if CPvalue == 2 then
task.wait(1)
debounce = false
bruh.CanTouch = true
elseif CPvalue ~= 2 then
CPvalue = 2
PP1.CanTouch = true
PP2.CanTouch = true
task.wait(1)
debounce = false
bruh.CanTouch = true
end
end
end)