so far i’ve did these checks to see if the player is actually trying to “compress” a prop instead of wanting to be a skid
if player.Character:FindFirstChild("COMPRESS") == nil then
return
elseif player.Character.COMPRESS.object.Value ~= "" then
return
end
task.wait() -- value should have updated by now
if player.Character:FindFirstChild("COMPRESS") == nil then
return
end
if player.Character.COMPRESS.object.Value == "" then
print("snoozer")
return
end
but the 2nd check seems to always return true no matter what i set the wait timer to, is it being cached or something? if so how do i prevent the caching?
update: object is cilent-sided, so i need a way to see if the compress is in pack mode or place mode, how in the hell do i do that securely
if im asking help about this, clearly there’s a specific way for a cilent to do this, like perhaps through a remoteevent and i didn’t include all of the script because that would be excess, and i need to see the cilent having the correct permissions to do ths
The title is confusing and there is not enough context.
I mean, technically the client can technically delete the entire server’s props and stuff, that is if you allow them to with an unsecured remote event that has the ability to delete things.
If it is client sided, consider it to be 100% unsecured. Either handle it on the server or acknowledge it can be changed by the client in whatever way they want. Other than that, I have no idea what this object value is doing other than compress (compress what, to what, do what, why an object value?)
What do you mean by this? You have given no context to this.
Is there a reason you need to do this? If you want it secure do it on the server unless whatever the object value is storing is only on the client for some reason?
I specified props because props (and props only) use a id system which checks if it exists in the replicatedstorage prop folder and if so, allows the client to delete it, compress is a gear that allows you to package (or delete and store as a object value) and place it back down
(everytime i say object value, assume string value)
requires client server communication, and the server has to trust the client which is a #badidea obviously (also exploiters can read anything given to the client)
Game is multiplayer > prop placer is a gear that fires a event (which is as secured as i can make it) > new gear that acts like a prop placer and deleter (it deletes a gear, then sets the object name to its string value, then enters placing mode which acts like a prop placer without a part to delete itself) > i need to secure the deleter part
(also i can’t access the mouse on server 3:<)
game.ReplicatedStorage.kill.OnServerEvent:Connect(function(player, id)
if player.Character:FindFirstChild("COMPRESS") == nil then
return
elseif player.Character.COMPRESS.object.Value ~= "" then
return
end
task.wait() -- value should have updated by now
if player.Character:FindFirstChild("COMPRESS") == nil then
return
end
if player.Character.COMPRESS.object.Value == "" then
print("snoozer")
return
end
if workspace:FindFirstChild("MAPDATA") ~= nil then
for i, v in workspace.MAPDATA:GetDescendants() do
if v:GetAttribute("ID") == id then
v:Destroy()
return
end
end
end
for i, v in workspace.PlacedProps:GetDescendants() do
if v:GetAttribute("ID") == id then
v:Destroy()
end
end
end)
and this hell of a gear
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Props = ReplicatedStorage:WaitForChild("Props")
local Data = ReplicatedStorage:WaitForChild("Data")
local Tool = script.Parent
local player = game.Players.LocalPlayer
local shadow:Model
local mouse = player:GetMouse()
local debounce = false
local position = mouse.Hit.Position
local RunService = game:GetService("RunService")
local destr = true
local this
Tool.Activated:Connect(function()
if debounce == false then
debounce = true
local ObjectName = Tool:FindFirstChild("object") and Tool.object.Value
if Tool.object.Value == "" then -- pack mode
if mouse.Target:FindFirstAncestorWhichIsA("Model") ~= nil then
if Props:FindFirstChild(mouse.Target:FindFirstAncestorWhichIsA("Model").Name) ~= nil then
if Data.DreamValue.Value == Data.MaxDreams.Value+6 then
Tool.object.Value = "ሿሿሿሿሿሿሿሿሿሿ"
game.ReplicatedStorage:WaitForChild("kill"):FireServer(mouse.Target:FindFirstAncestorWhichIsA("Model"):GetAttribute("ID"))
debounce = false
shadow = game.ReplicatedStorage.Props[Tool.object.Value]
for i, v in shadow:GetDescendants() do
if v:IsA("BasePart") then
v.Anchored = true
v.CanCollide = false
v.CanQuery = false
local red = v.Color.R
local green = v.Color.G
local blue = v.Color.B
if v.Transparency <= 0.5 then
v.Transparency = 0.5
end
-- color time
if green > 0.25 then
v.Color = Color3.new(0,green,0)
elseif red > 0.25 then
v.Color = Color3.new(0,red,0)
elseif blue > 0.25 then
v.Color = Color3.new(0,blue,0)
else
v.Color = Color3.new(0,green,0)
end
end
if v:IsA("Seat") then
v.Disabled = true
end
end
destr = false
return
end
Tool.object.Value = mouse.Target:FindFirstAncestorWhichIsA("Model").Name
game.ReplicatedStorage:WaitForChild("kill"):FireServer(mouse.Target:FindFirstAncestorWhichIsA("Model"):GetAttribute("ID"))
shadow = game.ReplicatedStorage.Props[Tool.object.Value]:Clone()
for i, v in shadow:GetDescendants() do
if v:IsA("BasePart") then
v.Anchored = true
v.CanCollide = false
v.CanQuery = false
local red = v.Color.R
local green = v.Color.G
local blue = v.Color.B
if v.Transparency <= 0.5 then
v.Transparency = 0.5
end
-- color time
if green > 0.25 then
v.Color = Color3.new(0,green,0)
elseif red > 0.25 then
v.Color = Color3.new(0,red,0)
elseif blue > 0.25 then
v.Color = Color3.new(0,blue,0)
else
v.Color = Color3.new(0,green,0)
end
end
if v:IsA("Seat") then
v.Disabled = true
end
end
destr = false
end
end
task.wait(0.1)
debounce = false
return -- dont spawn anything after this
end
local mousePos = mouse.Hit.Position
game.ReplicatedStorage:WaitForChild("PlacePropAtMouse"):FireServer(ObjectName, mousePos)
Tool.object.Value = ""
destr = true
shadow.Parent = nil
shadow = nil
task.wait(0.1)
debounce = false
end
end)
Tool.Equipped:Connect(function(mouse: Mouse)
this = RunService.RenderStepped:Connect(function()
if destr == false then
if shadow then
if shadow.Parent == nil then
shadow.Parent = workspace
end
end
position = mouse.Hit.Position
shadow:PivotTo(CFrame.new(position))
end
end)
end)
Tool.Unequipped:Connect(function()
if shadow then
shadow.Parent = nil
end
destr = true
this:Disconnect()
end)
Make client only fires mouse-related information and server checks all, change the value and server sends the position where prop to move and client changes displaying-prop’s position and when client fires to place prop, server checks if its position is available and place it. I think it would be okay because when hackers send fake event, server will check if that position is available and it can ignore if it’s not available. Sorry if I told you weird thing.
uhhh positions are free-form (aka they can be placed anywhere) but I think this is still a good idea, going to go do this after im dong with my voting script