1.
लक्ष्य
यह Roblox gameplay का classic block सिखाता है: world में रखी Part contact पर react करती है और player का score update करती है.
leaderstats और Touched event को जोड़कर simple score trigger बनाएं.
लेसन का सारांश
यह Roblox gameplay का classic block सिखाता है: world में रखी Part contact पर react करती है और player का score update करती है.
25-35 मिनट / शुरुआती
Part touch करने पर score बदलता है.
शुरू करने से पहले
जब आपको पता होता है कि स्क्रीन पर क्या दिखना चाहिए और कौन सा नतीजा पूरा माना जाएगा, तो लेसन बहुत आसानी से आगे बढ़ता है.
यह Roblox gameplay का classic block सिखाता है: world में रखी Part contact पर react करती है और player का score update करती है.
leaderstats folder और IntValue setup करें ताकि हर player का score दिखाई दे.
Part touch करने पर score बदलता है.
local part = script.Parent
part.Touched:Connect(function(hit)
local character = hit.Parent
local player = game.Players:GetPlayerFromCharacter(character)
if not player then return end
local leaderstats = player:FindFirstChild("leaderstats")
local score = leaderstats and leaderstats:FindFirstChild("Score")
if score then
score.Value += 1
end
end)