You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear! i want my local script to detect a change in the intvalue within my car, the intvalue is changed by a server script
-
What is the issue? Include screenshots / videos if possible! It isnt being detected
-
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I looked everywhere noone has the specific problem i have
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that itâs easier for people to help you!
Server script that clones the car and after 5 seconds, changes the cars intvalue
local replicatedstorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local random = math.random(1,5)
Players.PlayerAdded:Connect(function(player)
wait(random)
print(random)
print(player.Name .. " joined the game!")
local car = replicatedstorage.CAR1
local cone = car:Clone()
cone.Parent = game.Workspace
for i,v in pairs(workspace["MAP BEACH"]:GetChildren()) do
if v:IsA("Part") then
if v:FindFirstChildWhichIsA("BoolValue")then
if v.Value.Value == false then
v.Value.Value = true
cone:PivotTo(v.CFrame)
end
end
end
end
wait(2)
cone.Chassis.DriveSeat:Sit(player.Character.Humanoid)
player.Character.Humanoid.JumpHeight = 0
cone.Chassis.Owner.Value = player.Name
cone.Chassis.Health.Value = 100000000
wait(5)
cone.Chassis.Health.Value = 2
end)
local script:
wait(7)
local car = nil
local Players = game:GetService("Players")
local player = Players.LocalPlayer
for i,v in pairs(game.Workspace:GetChildren()) do
if v:IsA("Model")then
if v:FindFirstChild("Chassis") then
if v.Chassis.Owner.Value == player.Name then
car = v.Chassis
end
end
end
end
local function healthchanger()
local gui = game:GetService("StarterGui").ScreenGui.Frame.HELTH
car.Health.Value = tostring(gui.Text)
end
car.Health:GetPropertyChangedSignal("Value"):Connect(healthchanger)
wait(5)
print(car.Health.Value)
IF YOU HAVE ANY QUESTIONS ABOUT THE SCRIPT PLEASE QUOTE IT AND ASK ME
output:
Please do not ask people to write entire scripts or design entire systems for you. If you canât answer the three questions above, you should probably pick a different category.